setup -carbon flag in toolchain file

This commit is contained in:
Wolfgang Thaller 2019-01-09 00:11:12 +01:00
parent bbc3a1f049
commit 35dedc550a
5 changed files with 14 additions and 16 deletions

View File

@ -18,7 +18,6 @@ add_application(HelloWorld
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()

View File

@ -36,23 +36,22 @@ if(APPLE)
target_link_libraries(Raytracer "-framework Carbon")
target_link_libraries(Raytracer2 "-framework Carbon")
else()
# save 200KB of code by removing unused stuff
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections")
add_application(Raytracer
raytracer.c
)
target_link_libraries(Raytracer "-lm")
target_link_libraries(Raytracer "-lm")
add_application(Raytracer2
raytracer2.cc
fixed.h
fixed.cc
)
if(NOT (CMAKE_SYSTEM_NAME MATCHES RetroCarbon))
)
add_application(FixedBenchmark CONSOLE
FILES fixedbenchmark.cc fixed.h fixed.cc)
endif()
add_application(FixedBenchmark CONSOLE
FILES fixedbenchmark.cc fixed.h fixed.cc)
# save 200KB of code by removing unused stuff
set_target_properties(Raytracer PROPERTIES LINK_FLAGS "-Wl,-gc-sections")
set_target_properties(Raytracer2 PROPERTIES LINK_FLAGS "-Wl,-gc-sections")
endif()

View File

@ -5,7 +5,7 @@ cmake_policy(SET CMP0012 NEW)
function(add_application name)
set(options DEBUGBREAK CONSOLE CARBON CLASSIC)
set(options DEBUGBREAK CONSOLE)
set(oneValueArgs TYPE CREATOR)
set(multiValueArgs FILES MAKEAPPL_ARGS)
@ -15,7 +15,7 @@ function(add_application name)
set(REZ_FLAGS)
if(CMAKE_SYSTEM_NAME MATCHES RetroPPC OR CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
if((CMAKE_SYSTEM_NAME MATCHES RetroCarbon OR ARGS_CARBON) AND NOT ARGS_CLASSIC)
if(CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
set(REZ_FLAGS -DTARGET_API_MAC_CARBON=1)
endif()
endif()
@ -95,10 +95,8 @@ function(add_application name)
add_custom_target(${name}_APPL ALL DEPENDS ${name}.bin)
elseif(CMAKE_SYSTEM_NAME MATCHES RetroPPC OR CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
if((CMAKE_SYSTEM_NAME MATCHES RetroCarbon OR ARGS_CARBON) AND NOT ARGS_CLASSIC)
if(CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
set(REZ_TEMPLATE "${REZ_TEMPLATES_PATH}/RetroCarbonAPPL.r")
target_compile_definitions(${name} PUBLIC -DTARGET_API_MAC_CARBON=1)
target_link_libraries(${name} -carbon)
else()
set(REZ_TEMPLATE "${REZ_TEMPLATES_PATH}/RetroPPCAPPL.r")
endif()

View File

@ -28,7 +28,8 @@ set( REZ_INCLUDE_PATH "${CMAKE_INSTALL_PREFIX}/RIncludes" )
set( CMAKE_C_COMPILER "${RETRO68_ROOT}/bin/powerpc-apple-macos-gcc" )
set( CMAKE_CXX_COMPILER "${RETRO68_ROOT}/bin/powerpc-apple-macos-g++" )
set( CMAKE_EXE_LINKER_FLAGS_INIT "-carbon" )
list( APPEND CMAKE_MODULE_PATH "@CMAKE_SOURCE_DIR@/cmake" )
add_definitions( -DTARGET_API_MAC_CARBON=1 )
add_definitions( -DTARGET_API_MAC_CARBON=1 )

View File

@ -28,6 +28,7 @@ set( REZ_INCLUDE_PATH "${RETRO68_ROOT}/m68k-apple-macos/RIncludes" )
set( CMAKE_C_COMPILER "${RETRO68_ROOT}/bin/powerpc-apple-macos-gcc" )
set( CMAKE_CXX_COMPILER "${RETRO68_ROOT}/bin/powerpc-apple-macos-g++" )
set( CMAKE_EXE_LINKER_FLAGS_INIT "-carbon" )
set( REZ_TEMPLATES_PATH ${REZ_INCLUDE_PATH})