From dac64071342266fc5f09bfa8ded2183e47da6d9a Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Fri, 23 Aug 2024 13:17:29 +0200 Subject: [PATCH] Fix windows build. Signed-off-by: Pol Henarejos --- CMakeLists.txt | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0b67bc..08ed5cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,31 +127,37 @@ target_include_directories(pico_fido PUBLIC ${INCLUDES}) target_compile_options(pico_fido PUBLIC -Wall + ) +if (NOT MSVC) +target_compile_options(pico_fido PUBLIC -Werror ) + string(FIND ${CMAKE_C_COMPILER} ":" COMPILER_COLON) if (${COMPILER_COLON} GREATER_EQUAL 0) target_compile_options(pico_fido PUBLIC -Wno-error=use-after-free ) endif() +endif(NOT MSVC) if(ENABLE_EMULATION) - -target_compile_options(pico_fido PUBLIC - -fdata-sections - -ffunction-sections - ) - if(APPLE) - target_link_options(pico_fido PUBLIC - -Wl,-dead_strip - ) - else() - target_link_options(pico_fido PUBLIC - -Wl,--gc-sections - ) - target_link_libraries(pico_fido PRIVATE m) - endif (APPLE) + if(NOT MSVC) + target_compile_options(pico_fido PUBLIC + -fdata-sections + -ffunction-sections + ) + endif(NOT MSVC) + if(APPLE) + target_link_options(pico_fido PUBLIC + -Wl,-dead_strip + ) + else() + target_link_options(pico_fido PUBLIC + -Wl,--gc-sections + ) + target_link_libraries(pico_fido PRIVATE m) + endif (APPLE) else() 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)