From 71c8939dd7f8768580fac2e13ba2cb41a3ee4fad Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Thu, 18 Jul 2024 10:31:58 -0700 Subject: [PATCH 1/2] Enable importing the Synchronization module --- Sources/Foundation/CMakeLists.txt | 8 ++++---- Sources/FoundationNetworking/CMakeLists.txt | 8 ++++---- Sources/FoundationXML/CMakeLists.txt | 8 ++++---- Sources/plutil/CMakeLists.txt | 6 ++---- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Sources/Foundation/CMakeLists.txt b/Sources/Foundation/CMakeLists.txt index 9904982181..6c5426b1f6 100644 --- a/Sources/Foundation/CMakeLists.txt +++ b/Sources/Foundation/CMakeLists.txt @@ -160,14 +160,14 @@ if(NOT BUILD_SHARED_LIBS) "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend CoreFoundation>") target_compile_options(Foundation PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationICU>") + target_compile_options(Foundation PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") endif() -target_link_options(Foundation PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(Foundation PROPERTIES INSTALL_RPATH "$ORIGIN" - BUILD_RPATH "$") + BUILD_RPATH "$" + INSTALL_REMOVE_ENVIRONMENT_RPATH ON) target_link_libraries(Foundation PUBLIC swiftDispatch) diff --git a/Sources/FoundationNetworking/CMakeLists.txt b/Sources/FoundationNetworking/CMakeLists.txt index 106add318c..90e5ddeef1 100644 --- a/Sources/FoundationNetworking/CMakeLists.txt +++ b/Sources/FoundationNetworking/CMakeLists.txt @@ -60,13 +60,13 @@ if(NOT BUILD_SHARED_LIBS) "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _CFURLSessionInterface>") target_compile_options(FoundationNetworking PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend curl>") + target_compile_options(FoundationNetworking PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") endif() -target_link_options(FoundationNetworking PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(FoundationNetworking PROPERTIES - INSTALL_RPATH "$ORIGIN") + INSTALL_RPATH "$ORIGIN" + INSTALL_REMOVE_ENVIRONMENT_RPATH ON) if(LINKER_SUPPORTS_BUILD_ID) target_link_options(FoundationNetworking PRIVATE "LINKER:--build-id=sha1") diff --git a/Sources/FoundationXML/CMakeLists.txt b/Sources/FoundationXML/CMakeLists.txt index 0ac926fa34..f5676bb359 100644 --- a/Sources/FoundationXML/CMakeLists.txt +++ b/Sources/FoundationXML/CMakeLists.txt @@ -35,13 +35,13 @@ if(NOT BUILD_SHARED_LIBS) "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _CFXMLInterface>") target_compile_options(FoundationXML PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend xml2>") + target_compile_options(FoundationNetworking PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") endif() -target_link_options(FoundationXML PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(FoundationXML PROPERTIES - INSTALL_RPATH "$ORIGIN") + INSTALL_RPATH "$ORIGIN" + INSTALL_REMOVE_ENVIRONMENT_RPATH ON) if(LINKER_SUPPORTS_BUILD_ID) target_link_options(FoundationXML PRIVATE "LINKER:--build-id=sha1") diff --git a/Sources/plutil/CMakeLists.txt b/Sources/plutil/CMakeLists.txt index a6795e6894..19c18f59f0 100644 --- a/Sources/plutil/CMakeLists.txt +++ b/Sources/plutil/CMakeLists.txt @@ -18,11 +18,9 @@ add_executable(plutil target_link_libraries(plutil PRIVATE Foundation) -target_link_options(plutil PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(plutil PROPERTIES - INSTALL_RPATH "$ORIGIN/../lib/swift/${SWIFT_SYSTEM_NAME}") + INSTALL_RPATH "$ORIGIN/../lib/swift/${SWIFT_SYSTEM_NAME}" + INSTALL_REMOVE_ENVIRONMENT_RPATH ON) set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS plutil) install(TARGETS plutil From 9fb2f718dc37a775769d560117c0419adc67938a Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Thu, 18 Jul 2024 12:40:45 -0700 Subject: [PATCH 2/2] Fix build failure --- Sources/FoundationXML/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FoundationXML/CMakeLists.txt b/Sources/FoundationXML/CMakeLists.txt index f5676bb359..72021afb38 100644 --- a/Sources/FoundationXML/CMakeLists.txt +++ b/Sources/FoundationXML/CMakeLists.txt @@ -35,7 +35,7 @@ if(NOT BUILD_SHARED_LIBS) "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _CFXMLInterface>") target_compile_options(FoundationXML PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend xml2>") - target_compile_options(FoundationNetworking PRIVATE + target_compile_options(FoundationXML PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") endif()