From 9a493b99726755dc2909b0551a555e3a780fede0 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Thu, 23 Feb 2023 07:57:11 +0100 Subject: [PATCH] Fix for non apple builds Signed-off-by: Pol Henarejos --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46af1c9..6b040ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,9 +134,16 @@ target_compile_options(pico_fido PUBLIC -fdata-sections -ffunction-sections ) + if(APPLE) target_link_options(pico_fido PUBLIC - -Wl,-dead_strip - ) + -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_hsm_sdk pico_stdlib pico_multicore hardware_flash hardware_sync hardware_adc pico_unique_id hardware_rtc tinyusb_device tinyusb_board)