Skip to content

Commit 1aaa96a

Browse files
committed
Enable building as static libs
1 parent cf97877 commit 1aaa96a

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

Sources/Foundation/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
##===----------------------------------------------------------------------===##
1414

1515
file(GLOB_RECURSE _FoundationSources "*.swift")
16-
add_library(Foundation SHARED ${_FoundationSources})
16+
add_library(Foundation ${_FoundationSources})
1717

1818
target_compile_options(Foundation PRIVATE
1919
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")

Sources/FoundationNetworking/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
##===----------------------------------------------------------------------===##
1414

1515
file(GLOB_RECURSE _FoundationNetworkingSources "*.swift")
16-
add_library(FoundationNetworking SHARED ${_FoundationNetworkingSources})
16+
add_library(FoundationNetworking ${_FoundationNetworkingSources})
1717

1818
target_compile_options(FoundationNetworking PRIVATE
1919
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")

Sources/FoundationXML/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
##===----------------------------------------------------------------------===##
1414

1515
file(GLOB_RECURSE _FoundationXMLSources "*.swift")
16-
add_library(FoundationXML SHARED ${_FoundationXMLSources})
16+
add_library(FoundationXML ${_FoundationXMLSources})
1717

1818
target_compile_options(FoundationXML PRIVATE
1919
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")

Sources/_CFURLSessionInterface/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ target_link_libraries(_CFURLSessionInterface PRIVATE
3131
CoreFoundation
3232
dispatch
3333
CURL::libcurl)
34+
35+
if(NOT BUILD_SHARED_LIBS)
36+
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS _CFURLSessionInterface)
37+
endif()

Sources/_CFXMLInterface/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ target_link_libraries(_CFXMLInterface PRIVATE
3030
CoreFoundation
3131
dispatch
3232
LibXml2::LibXml2)
33+
34+
if(NOT BUILD_SHARED_LIBS)
35+
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS _CFXMLInterface)
36+
endif()

0 commit comments

Comments
 (0)