mirror of
https://github.com/darlinghq/darling-libclosure.git
synced 2024-11-23 04:09:47 +00:00
45 lines
1.1 KiB
CMake
45 lines
1.1 KiB
CMake
project(system_blocks)
|
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
if(COMMAND cmake_policy)
|
|
cmake_policy(SET CMP0003 NEW)
|
|
endif(COMMAND cmake_policy)
|
|
|
|
include(darling_static_lib)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc")
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib -Wl,-flat_namespace -Wl,-undefined,suppress")
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_definitions(-DHAVE_STDINT_H=1)
|
|
|
|
set(blocks_sources
|
|
data.c
|
|
data.m
|
|
runtime.cpp
|
|
)
|
|
|
|
set(DYLIB_INSTALL_NAME "/usr/lib/system/libsystem_blocks.dylib")
|
|
add_circular(system_blocks FAT
|
|
SOURCES
|
|
${blocks_sources}
|
|
SIBLINGS
|
|
system_kernel
|
|
system_malloc
|
|
system_pthread
|
|
system_c
|
|
# UPWARD
|
|
# objc_firstpass
|
|
)
|
|
add_darling_static_library(system_blocks_static SOURCES ${blocks_sources})
|
|
set_property(TARGET system_blocks_static APPEND_STRING PROPERTY
|
|
COMPILE_FLAGS " -fPIC -fno-stack-check -fno-stack-protector")
|
|
#target_link_libraries(system_blocks PRIVATE system_kernel system_m system_malloc)
|
|
|
|
#make_fat(system_blocks)
|
|
make_fat(system_blocks_static)
|
|
|
|
install(TARGETS system_blocks DESTINATION libexec/darling/usr/lib/system)
|