From eda604ac150c77bedff1bea7ddd257024d7566c1 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Wed, 28 May 2025 18:20:50 -0700 Subject: [PATCH] Build: Adjust linking for the static Windows build When linking against a static `swiftSynchronization`, the proper prefix needs to be specified. --- Sources/Foundation/CMakeLists.txt | 2 +- Sources/FoundationNetworking/CMakeLists.txt | 2 +- Sources/FoundationXML/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Foundation/CMakeLists.txt b/Sources/Foundation/CMakeLists.txt index f6299e5c90..c901e5ab24 100644 --- a/Sources/Foundation/CMakeLists.txt +++ b/Sources/Foundation/CMakeLists.txt @@ -161,7 +161,7 @@ if(NOT BUILD_SHARED_LIBS) target_compile_options(Foundation PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationICU>") target_compile_options(Foundation PRIVATE - "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend $<$:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>swiftSynchronization>") endif() if(dispatch_FOUND) diff --git a/Sources/FoundationNetworking/CMakeLists.txt b/Sources/FoundationNetworking/CMakeLists.txt index ec0818baeb..ef7944b5e0 100644 --- a/Sources/FoundationNetworking/CMakeLists.txt +++ b/Sources/FoundationNetworking/CMakeLists.txt @@ -61,7 +61,7 @@ if(NOT BUILD_SHARED_LIBS) target_compile_options(FoundationNetworking PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend curl>") target_compile_options(FoundationNetworking PRIVATE - "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend $<$:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>swiftSynchronization>") if(BUILD_FULLY_STATIC) target_compile_options(FoundationNetworking diff --git a/Sources/FoundationXML/CMakeLists.txt b/Sources/FoundationXML/CMakeLists.txt index bb3f78bf4d..74aed77a33 100644 --- a/Sources/FoundationXML/CMakeLists.txt +++ b/Sources/FoundationXML/CMakeLists.txt @@ -36,7 +36,7 @@ if(NOT BUILD_SHARED_LIBS) target_compile_options(FoundationXML PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend xml2>") target_compile_options(FoundationXML PRIVATE - "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend $<$:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>swiftSynchronization>") if(BUILD_FULLY_STATIC) target_compile_options(FoundationXML