From 12271ebb969aa99c4410da0abd12c71c1596478f Mon Sep 17 00:00:00 2001 From: Evgenii Mozharovskii Date: Thu, 6 Aug 2026 14:20:58 +0100 Subject: [PATCH 1/4] fix(windows): autolink static networking dependencies Use the same static curl and compression archives in CMake builds that the package manifest already selects on Windows. --- Sources/FoundationNetworking/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Sources/FoundationNetworking/CMakeLists.txt b/Sources/FoundationNetworking/CMakeLists.txt index 88de57ca2c..8a44dd3bba 100644 --- a/Sources/FoundationNetworking/CMakeLists.txt +++ b/Sources/FoundationNetworking/CMakeLists.txt @@ -58,8 +58,16 @@ 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>") + if(WIN32) + 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>") From 024390275f67c7f2535cc808c2789579af27e8ac Mon Sep 17 00:00:00 2001 From: Evgenii Mozharovskii Date: Thu, 6 Aug 2026 17:18:33 +0100 Subject: [PATCH 2/4] fix(windows): align CMake platform condition --- Sources/FoundationNetworking/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FoundationNetworking/CMakeLists.txt b/Sources/FoundationNetworking/CMakeLists.txt index 8a44dd3bba..f08b68f656 100644 --- a/Sources/FoundationNetworking/CMakeLists.txt +++ b/Sources/FoundationNetworking/CMakeLists.txt @@ -58,7 +58,7 @@ target_link_libraries(FoundationNetworking if(NOT BUILD_SHARED_LIBS) target_compile_options(FoundationNetworking PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _CFURLSessionInterface>") - if(WIN32) + 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>" From 2d06f93afdef02ba90885662a2889167499382ed Mon Sep 17 00:00:00 2001 From: Evgenii Mozharovskii Date: Thu, 6 Aug 2026 20:24:53 +0100 Subject: [PATCH 3/4] docs(windows): explain static curl dependency split --- Sources/FoundationNetworking/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/FoundationNetworking/CMakeLists.txt b/Sources/FoundationNetworking/CMakeLists.txt index f08b68f656..7673a06cb9 100644 --- a/Sources/FoundationNetworking/CMakeLists.txt +++ b/Sources/FoundationNetworking/CMakeLists.txt @@ -58,6 +58,9 @@ target_link_libraries(FoundationNetworking if(NOT BUILD_SHARED_LIBS) target_compile_options(FoundationNetworking PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _CFURLSessionInterface>") + + # 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>" From fcd833c021a62178fb1c4a876de76bd2f2a2c473 Mon Sep 17 00:00:00 2001 From: Evgenii Mozharovskii Date: Thu, 6 Aug 2026 20:58:21 +0100 Subject: [PATCH 4/4] fix(windows): autolink static FoundationXML dependency --- Sources/FoundationXML/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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>")