diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c2a9e5..ce1a942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,12 @@ project(sbc_harness) pico_sdk_init() +if ((PICO_PLATFORM STREQUAL "host") AND (NOT PICO_NO_GC_SECTIONS)) + # On non-host builds, this is done by `pico_standard_link`. + add_compile_options(-ffunction-sections -fdata-sections) + add_link_options("LINKER:--gc-sections") +endif() + add_compile_options(-Wall -Wextra -Wswitch-enum -Werror) string(TOUPPER "${CMAKE_BUILD_TYPE}" _upper_cmake_build_type) |