Skip to content

Commit 5567e77

Browse files
authored
Merge pull request #2568 from compnerd/static-installation
build: install CoreFoundation libraries for static builds
2 parents 3e57ba1 + d64e7d8 commit 5567e77

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ if(ENABLE_TESTING)
6060
add_subdirectory(TestFoundation)
6161
endif()
6262

63-
add_subdirectory(cmake/modules)
64-
63+
if(NOT BUILD_SHARED_LIBS)
64+
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS
65+
CoreFoundation CFXMLInterface CFURLSessionInterface)
66+
install(TARGETS CoreFoundation CXFXMLInterface CFURLSessionInterface
67+
DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>)
68+
endif()
6569
# TODO(compnerd) install as a Framework as that is how swift actually is built
6670
install(DIRECTORY
6771
${CMAKE_CURRENT_BINARY_DIR}/CoreFoundation.framework/Headers/
@@ -90,3 +94,5 @@ install(FILES
9094
CoreFoundation/Parsing.subproj/module.map
9195
DESTINATION
9296
lib/swift/CFXMLInterface)
97+
98+
add_subdirectory(cmake/modules)

0 commit comments

Comments
 (0)