summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-14 01:11:17 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-14 01:11:17 -0700
commitf7c75fe0113cdbd3e13b4e22edf76d9456c4b064 (patch)
treed65c0c26f7d100085d6a563aea9df1b501cbbd19 /CMakeLists.txt
parent7eda822ef31a15d22de03fc1eec7d995f661b26d (diff)
parenta02f59f255006a2d6cb236fe2448b69c9c223adb (diff)
Merge branch 'lukeshu/9p-code-size'
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
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)