Fix windows build.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-08-23 13:17:29 +02:00
parent f49833291f
commit dac6407134
No known key found for this signature in database
GPG Key ID: C0095B7870A4CCD3

View File

@ -127,31 +127,37 @@ target_include_directories(pico_fido PUBLIC ${INCLUDES})
target_compile_options(pico_fido PUBLIC target_compile_options(pico_fido PUBLIC
-Wall -Wall
)
if (NOT MSVC)
target_compile_options(pico_fido PUBLIC
-Werror -Werror
) )
string(FIND ${CMAKE_C_COMPILER} ":" COMPILER_COLON) string(FIND ${CMAKE_C_COMPILER} ":" COMPILER_COLON)
if (${COMPILER_COLON} GREATER_EQUAL 0) if (${COMPILER_COLON} GREATER_EQUAL 0)
target_compile_options(pico_fido PUBLIC target_compile_options(pico_fido PUBLIC
-Wno-error=use-after-free -Wno-error=use-after-free
) )
endif() endif()
endif(NOT MSVC)
if(ENABLE_EMULATION) if(ENABLE_EMULATION)
if(NOT MSVC)
target_compile_options(pico_fido PUBLIC target_compile_options(pico_fido PUBLIC
-fdata-sections -fdata-sections
-ffunction-sections -ffunction-sections
) )
if(APPLE) endif(NOT MSVC)
target_link_options(pico_fido PUBLIC if(APPLE)
-Wl,-dead_strip target_link_options(pico_fido PUBLIC
) -Wl,-dead_strip
else() )
target_link_options(pico_fido PUBLIC else()
-Wl,--gc-sections target_link_options(pico_fido PUBLIC
) -Wl,--gc-sections
target_link_libraries(pico_fido PRIVATE m) )
endif (APPLE) target_link_libraries(pico_fido PRIVATE m)
endif (APPLE)
else() else()
pico_add_extra_outputs(pico_fido) pico_add_extra_outputs(pico_fido)
target_link_libraries(pico_fido PRIVATE pico_keys_sdk pico_stdlib pico_multicore hardware_flash hardware_sync hardware_adc pico_unique_id hardware_rtc tinyusb_device tinyusb_board) target_link_libraries(pico_fido PRIVATE pico_keys_sdk pico_stdlib pico_multicore hardware_flash hardware_sync hardware_adc pico_unique_id hardware_rtc tinyusb_device tinyusb_board)