diff --git a/Sources/FoundationNetworking/CMakeLists.txt b/Sources/FoundationNetworking/CMakeLists.txt index 88de57ca2c..7673a06cb9 100644 --- a/Sources/FoundationNetworking/CMakeLists.txt +++ b/Sources/FoundationNetworking/CMakeLists.txt @@ -58,8 +58,19 @@ target_link_libraries(FoundationNetworking if(NOT BUILD_SHARED_LIBS) target_compile_options(FoundationNetworking PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _CFURLSessionInterface>") - target_compile_options(FoundationNetworking PRIVATE - "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend curl>") + + # The Windows SDK's curl uses Schannel, zlib, and Brotli. The static Linux + # SDK's curl uses OpenSSL and zlib, which BUILD_FULLY_STATIC supplies below. + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + target_compile_options(FoundationNetworking PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend libcurl>" + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend zlibstatic>" + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend brotlicommon>" + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend brotlidec>") + else() + target_compile_options(FoundationNetworking PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend curl>") + endif() target_compile_options(FoundationNetworking PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend $<$:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>swiftSynchronization>") diff --git a/Sources/FoundationXML/CMakeLists.txt b/Sources/FoundationXML/CMakeLists.txt index 74aed77a33..2e231aa591 100644 --- a/Sources/FoundationXML/CMakeLists.txt +++ b/Sources/FoundationXML/CMakeLists.txt @@ -33,8 +33,13 @@ target_link_libraries(FoundationXML if(NOT BUILD_SHARED_LIBS) target_compile_options(FoundationXML PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _CFXMLInterface>") - target_compile_options(FoundationXML PRIVATE - "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend xml2>") + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + target_compile_options(FoundationXML PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend libxml2s>") + else() + target_compile_options(FoundationXML PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend xml2>") + endif() target_compile_options(FoundationXML PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend $<$:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>swiftSynchronization>")