From c10538e35061a51563aeecc646af339ffb158be0 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Sat, 30 Sep 2017 23:38:23 +0200 Subject: [PATCH] build Samples/Dialog as single-segment app (to prevent the code path from rotting) --- Samples/Dialog/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Samples/Dialog/CMakeLists.txt b/Samples/Dialog/CMakeLists.txt index beb1e50e62..3c5e66611f 100644 --- a/Samples/Dialog/CMakeLists.txt +++ b/Samples/Dialog/CMakeLists.txt @@ -27,3 +27,11 @@ add_application(Dialog dialog.c dialog.r ) + +# Enable -ffunction-sections and -gc-sections to make the app as small as possible +# also enable --mac-single to build it as a single-segment app (so that this code path doesn't rot) +set_target_properties(Dialog + PROPERTIES + COMPILE_OPTIONS -ffunction-sections + LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-single" + )