Fix #28: Don't pass Elf2Mac options on PPC. There is life beyond the 68K.

This commit is contained in:
Wolfgang Thaller 2017-10-02 09:20:50 +02:00
parent 38a2bf10c9
commit 8b5f06cb9b
2 changed files with 16 additions and 12 deletions

View File

@ -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()

View File

@ -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()