2015-12-20 23:56:09 +00:00
|
|
|
if(COMMAND cmake_policy)
|
|
|
|
cmake_policy(SET CMP0003 NEW)
|
|
|
|
cmake_policy(SET CMP0011 NEW)
|
|
|
|
endif(COMMAND cmake_policy)
|
|
|
|
|
2017-01-09 14:34:04 +00:00
|
|
|
include(use_ld64)
|
2015-12-20 23:56:09 +00:00
|
|
|
|
|
|
|
FUNCTION(add_darling_executable exe)
|
|
|
|
foreach(f IN LISTS ARGN)
|
|
|
|
set(files ${files} ${f})
|
|
|
|
endforeach(f)
|
|
|
|
|
|
|
|
add_executable(${exe} ${files})
|
2017-01-09 14:34:04 +00:00
|
|
|
set_property(TARGET ${exe} APPEND_STRING PROPERTY
|
2022-10-13 03:50:25 +00:00
|
|
|
LINK_FLAGS " ${CMAKE_EXE_LINKER_FLAGS} -nostdlib ${CMAKE_BINARY_DIR}/src/external/csu/CMakeFiles/crt1.10.6.dir/start.S.o ")
|
2019-08-12 00:28:18 +00:00
|
|
|
|
2020-09-28 01:53:31 +00:00
|
|
|
if (BUILD_TARGET_64BIT)
|
|
|
|
target_compile_options(${exe} PRIVATE -arch ${APPLE_ARCH_64BIT})
|
|
|
|
elseif (BUILD_TARGET_32BIT)
|
|
|
|
target_compile_options(${exe} PRIVATE -arch ${APPLE_ARCH_32BIT})
|
2019-08-12 00:28:18 +00:00
|
|
|
set_property(TARGET ${exe} APPEND_STRING PROPERTY
|
2020-09-28 01:53:31 +00:00
|
|
|
LINK_FLAGS " -arch ${APPLE_ARCH_32BIT}")
|
|
|
|
endif (BUILD_TARGET_64BIT)
|
2019-08-12 00:28:18 +00:00
|
|
|
|
2017-01-09 14:34:04 +00:00
|
|
|
use_ld64(${exe})
|
2017-01-17 18:33:58 +00:00
|
|
|
target_link_libraries(${exe} system)
|
2022-10-13 03:50:25 +00:00
|
|
|
add_dependencies(${exe} crt1.10.6)
|
2018-07-30 10:22:45 +00:00
|
|
|
|
2020-05-05 00:34:23 +00:00
|
|
|
if ((NOT NO_DSYM) AND (NOT ${exe}_NO_DSYM))
|
2018-07-30 10:22:45 +00:00
|
|
|
dsym(${exe})
|
2020-05-05 00:34:23 +00:00
|
|
|
endif ((NOT NO_DSYM) AND (NOT ${exe}_NO_DSYM))
|
2015-12-20 23:56:09 +00:00
|
|
|
ENDFUNCTION(add_darling_executable)
|
|
|
|
|