Skip to content

Commit

Permalink
Enable building as static libs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmschonfeld committed Jun 10, 2024
1 parent cf97877 commit 1aaa96a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
##===----------------------------------------------------------------------===##

file(GLOB_RECURSE _FoundationSources "*.swift")
add_library(Foundation SHARED ${_FoundationSources})
add_library(Foundation ${_FoundationSources})

target_compile_options(Foundation PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")
Expand Down
2 changes: 1 addition & 1 deletion Sources/FoundationNetworking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
##===----------------------------------------------------------------------===##

file(GLOB_RECURSE _FoundationNetworkingSources "*.swift")
add_library(FoundationNetworking SHARED ${_FoundationNetworkingSources})
add_library(FoundationNetworking ${_FoundationNetworkingSources})

target_compile_options(FoundationNetworking PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")
Expand Down
2 changes: 1 addition & 1 deletion Sources/FoundationXML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
##===----------------------------------------------------------------------===##

file(GLOB_RECURSE _FoundationXMLSources "*.swift")
add_library(FoundationXML SHARED ${_FoundationXMLSources})
add_library(FoundationXML ${_FoundationXMLSources})

target_compile_options(FoundationXML PRIVATE
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:${_Foundation_swift_build_flags}>")
Expand Down
4 changes: 4 additions & 0 deletions Sources/_CFURLSessionInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ target_link_libraries(_CFURLSessionInterface PRIVATE
CoreFoundation
dispatch
CURL::libcurl)

if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS _CFURLSessionInterface)
endif()
4 changes: 4 additions & 0 deletions Sources/_CFXMLInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ target_link_libraries(_CFXMLInterface PRIVATE
CoreFoundation
dispatch
LibXml2::LibXml2)

if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS _CFXMLInterface)
endif()

0 comments on commit 1aaa96a

Please sign in to comment.