diff --git a/Console/CMakeLists.txt b/Console/CMakeLists.txt index d00754a988..f8524c0571 100644 --- a/Console/CMakeLists.txt +++ b/Console/CMakeLists.txt @@ -26,6 +26,9 @@ add_library(RetroConsole MacUtils.h InitConsole.cc ) +set_target_properties(retrocrt + PROPERTIES + COMPILE_OPTIONS -ffunction-sections) install(TARGETS RetroConsole DESTINATION lib) diff --git a/Samples/HelloWorld/CMakeLists.txt b/Samples/HelloWorld/CMakeLists.txt index 6b71e5f3e2..6d1d92fc63 100644 --- a/Samples/HelloWorld/CMakeLists.txt +++ b/Samples/HelloWorld/CMakeLists.txt @@ -10,3 +10,13 @@ add_application(HelloWorld hello.c CONSOLE ) + + # make the result as small as possible + # by removing unused code (gc-sections) + # and by removing macsbug function names + # (don't do this when debugging...) +set_target_properties(HelloWorld + PROPERTIES + COMPILE_OPTIONS -ffunction-sections + LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-strip-macsbug" + ) diff --git a/libretro/CMakeLists.txt b/libretro/CMakeLists.txt index 7ea19e6cc8..b6426aa4b0 100644 --- a/libretro/CMakeLists.txt +++ b/libretro/CMakeLists.txt @@ -71,5 +71,8 @@ add_library(retrocrt consolehooks.c ${ARCH_FILES} ) +set_target_properties(retrocrt + PROPERTIES + COMPILE_OPTIONS -ffunction-sections) install(TARGETS retrocrt DESTINATION lib)