2026-07-19 13:34:32 +01:00
|
|
|
cmake_minimum_required(VERSION 3.31)
|
|
|
|
|
project(xpc C ASM)
|
|
|
|
|
|
2026-03-10 19:14:37 +00:00
|
|
|
file(GLOB sources
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
|
|
|
|
file(GLOB headers
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/*.h
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include/xpc/*.h)
|
|
|
|
|
|
2026-07-19 13:34:32 +01:00
|
|
|
file(GLOB public_headers
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include/xpc/*.h)
|
|
|
|
|
|
2026-03-10 19:14:37 +00:00
|
|
|
set(public_include_dirs
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
|
|
|
|
2026-07-19 13:34:32 +01:00
|
|
|
if (XPC_STATIC)
|
|
|
|
|
add_library(xpc STATIC ${sources} ${headesr})
|
|
|
|
|
target_link_libraries(xpc magenta libc-core)
|
|
|
|
|
else ()
|
|
|
|
|
add_library(xpc SHARED ${sources} ${headesr})
|
|
|
|
|
target_link_libraries(xpc magenta c)
|
|
|
|
|
endif ()
|
2026-03-10 19:14:37 +00:00
|
|
|
|
2026-07-19 13:34:32 +01:00
|
|
|
target_include_directories(xpc PUBLIC ${public_include_dirs})
|
2026-03-10 19:14:37 +00:00
|
|
|
|
2026-07-19 13:34:32 +01:00
|
|
|
install(TARGETS xpc)
|
|
|
|
|
install(FILES ${public_headers} DESTINATION include/xpc)
|
2026-03-10 19:14:37 +00:00
|
|
|
#set_target_properties(libxpc-static PROPERTIES POSITION_INDEPENDENT_CODE FALSE)
|