2015-07-16 00:29:30 +00:00
|
|
|
# HOW TO BUILD USING CMAKE as a standalone project:
|
|
|
|
# mkdir build
|
|
|
|
# cd build
|
2018-07-20 14:28:01 +00:00
|
|
|
# cmake .. -DCMAKE_TOOLCHAIN_FILE=path/to/Retro68-build/toolchain/m68k-apple-macos/cmake/retro68.toolchain.cmake
|
2015-07-16 00:29:30 +00:00
|
|
|
# make
|
2015-07-15 23:26:11 +00:00
|
|
|
|
|
|
|
add_application(HelloWorld
|
2019-08-18 11:21:00 +00:00
|
|
|
hello.c
|
|
|
|
CONSOLE
|
2015-07-15 23:26:11 +00:00
|
|
|
)
|
2017-09-29 20:31:35 +00:00
|
|
|
|
|
|
|
# make the result as small as possible
|
2019-08-18 11:21:00 +00:00
|
|
|
# by removing unused code (gc-sections)
|
|
|
|
# and by removing macsbug function names on 68K
|
|
|
|
# (don't do this when debugging...)
|
2017-10-02 07:20:50 +00:00
|
|
|
set_target_properties(HelloWorld PROPERTIES COMPILE_OPTIONS -ffunction-sections)
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES Retro68)
|
2019-08-18 11:21:00 +00:00
|
|
|
set_target_properties(HelloWorld PROPERTIES LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-strip-macsbug")
|
2017-10-02 07:20:50 +00:00
|
|
|
else()
|
2019-08-18 11:21:00 +00:00
|
|
|
set_target_properties(HelloWorld PROPERTIES LINK_FLAGS "-Wl,-gc-sections")
|
2017-10-02 07:20:50 +00:00
|
|
|
endif()
|