set -ffunction-sections option on libretro and libConsole, and use gc-sections in Samples/HelloWorld.

This commit is contained in:
Wolfgang Thaller 2017-09-29 22:31:35 +02:00
parent 80443795d4
commit 821bc04a7a
3 changed files with 16 additions and 0 deletions

View File

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

View File

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

View File

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