From f132a184bedbf749d6149f7da88bac690c27365b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 22 May 2025 12:33:57 -0700 Subject: [PATCH] build: adjust the autolink library for Windows When building statically, ensure that we prefix the Swift libraries with the correct prefix to permit static linking of the libraries. --- Sources/FoundationEssentials/CMakeLists.txt | 2 +- Sources/FoundationInternationalization/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/FoundationEssentials/CMakeLists.txt b/Sources/FoundationEssentials/CMakeLists.txt index afdbdd507..8c2101d59 100644 --- a/Sources/FoundationEssentials/CMakeLists.txt +++ b/Sources/FoundationEssentials/CMakeLists.txt @@ -99,7 +99,7 @@ if(NOT BUILD_SHARED_LIBS) target_compile_options(FoundationEssentials PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend $<$:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>_FoundationCollections>") target_compile_options(FoundationEssentials PRIVATE - "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend $<$:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>swiftSynchronization>") endif() set_target_properties(FoundationEssentials PROPERTIES diff --git a/Sources/FoundationInternationalization/CMakeLists.txt b/Sources/FoundationInternationalization/CMakeLists.txt index 6cf0629ef..7edec0fb4 100644 --- a/Sources/FoundationInternationalization/CMakeLists.txt +++ b/Sources/FoundationInternationalization/CMakeLists.txt @@ -49,7 +49,7 @@ if(NOT BUILD_SHARED_LIBS) target_compile_options(FoundationInternationalization PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationICU>") target_compile_options(FoundationEssentials PRIVATE - "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend $<$:${CMAKE_STATIC_LIBRARY_PREFIX_Swift}>swiftSynchronization>") endif() set_target_properties(FoundationInternationalization PROPERTIES