Skip to content

Commit f2bb601

Browse files
committed
Install private static libs in static swift build
1 parent ff9b571 commit f2bb601

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Sources/CoreFoundation/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,11 @@ install(DIRECTORY
135135
${CMAKE_BINARY_DIR}/CoreFoundationHeaders/
136136
DESTINATION
137137
lib/swift/CoreFoundation)
138+
139+
if(NOT BUILD_SHARED_LIBS)
140+
get_swift_host_os(swift_os)
141+
install(TARGETS CoreFoundation
142+
ARCHIVE DESTINATION lib/swift_static/${swift_os}
143+
LIBRARY DESTINATION lib/swift_static/${swift_os}
144+
RUNTIME DESTINATION bin)
145+
endif()

Sources/_CFURLSessionInterface/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@ target_link_libraries(_CFURLSessionInterface PRIVATE
3333

3434
if(NOT BUILD_SHARED_LIBS)
3535
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS _CFURLSessionInterface)
36+
get_swift_host_os(swift_os)
37+
install(TARGETS _CFURLSessionInterface
38+
ARCHIVE DESTINATION lib/swift_static/${swift_os}
39+
LIBRARY DESTINATION lib/swift_static/${swift_os}
40+
RUNTIME DESTINATION bin)
3641
endif()

Sources/_CFXMLInterface/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ target_link_libraries(_CFXMLInterface PRIVATE
3232

3333
if(NOT BUILD_SHARED_LIBS)
3434
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS _CFXMLInterface)
35+
get_swift_host_os(swift_os)
36+
install(TARGETS _CFXMLInterface
37+
ARCHIVE DESTINATION lib/swift_static/${swift_os}
38+
LIBRARY DESTINATION lib/swift_static/${swift_os}
39+
RUNTIME DESTINATION bin)
3540
endif()

0 commit comments

Comments
 (0)