-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathCMakeLists.txt
41 lines (35 loc) · 1.17 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
add_library(FoundationXML
XMLDocument.swift
XMLDTD.swift
XMLDTDNode.swift
XMLElement.swift
XMLNode.swift
XMLParser.swift
CFAccess.swift)
target_compile_definitions(FoundationXML PRIVATE
DEPLOYMENT_RUNTIME_SWIFT)
target_compile_options(FoundationXML PUBLIC
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
target_link_libraries(FoundationXML
PRIVATE
CFXMLInterface
PUBLIC
Foundation)
if(NOT BUILD_SHARED_LIBS)
target_compile_options(FoundationXML
PRIVATE
"SHELL:-Xfrontend -public-autolink-library -Xfrontend xml2")
# Merge private dependencies into single static objects archive
set_property(TARGET FoundationXML PROPERTY STATIC_LIBRARY_OPTIONS
$<TARGET_OBJECTS:CFXMLInterface>)
endif()
set_target_properties(FoundationXML PROPERTIES
INSTALL_RPATH "$ORIGIN"
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
target_link_options(FoundationXML PRIVATE "SHELL:-no-toolchain-stdlib-rpath")
endif()
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML)
_install_target(FoundationXML)