From 8b5f06cb9b7786fb5f86fb1d9b358b93c833c264 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 2 Oct 2017 09:20:50 +0200 Subject: [PATCH] Fix #28: Don't pass Elf2Mac options on PPC. There is life beyond the 68K. --- Samples/Dialog/CMakeLists.txt | 14 ++++++++------ Samples/HelloWorld/CMakeLists.txt | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Samples/Dialog/CMakeLists.txt b/Samples/Dialog/CMakeLists.txt index 3c5e66611f..a7fd261870 100644 --- a/Samples/Dialog/CMakeLists.txt +++ b/Samples/Dialog/CMakeLists.txt @@ -29,9 +29,11 @@ add_application(Dialog ) # 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" - ) +# On 68K, 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) +if(CMAKE_SYSTEM_NAME MATCHES Retro68) + set_target_properties(Dialog PROPERTIES LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-single") + +else() + set_target_properties(Dialog PROPERTIES LINK_FLAGS "-Wl,-gc-sections") +endif() diff --git a/Samples/HelloWorld/CMakeLists.txt b/Samples/HelloWorld/CMakeLists.txt index 6d1d92fc63..33c408c242 100644 --- a/Samples/HelloWorld/CMakeLists.txt +++ b/Samples/HelloWorld/CMakeLists.txt @@ -13,10 +13,12 @@ add_application(HelloWorld # make the result as small as possible # by removing unused code (gc-sections) - # and by removing macsbug function names + # and by removing macsbug function names on 68K # (don't do this when debugging...) -set_target_properties(HelloWorld - PROPERTIES - COMPILE_OPTIONS -ffunction-sections - LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-strip-macsbug" - ) +set_target_properties(HelloWorld PROPERTIES COMPILE_OPTIONS -ffunction-sections) +if(CMAKE_SYSTEM_NAME MATCHES Retro68) + set_target_properties(HelloWorld PROPERTIES LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-strip-macsbug") + +else() + set_target_properties(HelloWorld PROPERTIES LINK_FLAGS "-Wl,-gc-sections") +endif()