diff --git a/Sources/FoundationEssentials/CMakeLists.txt b/Sources/FoundationEssentials/CMakeLists.txt index df86c256d..d9ebc2ebb 100644 --- a/Sources/FoundationEssentials/CMakeLists.txt +++ b/Sources/FoundationEssentials/CMakeLists.txt @@ -77,13 +77,13 @@ if(NOT BUILD_SHARED_LIBS) "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationCShims>") target_compile_options(FoundationEssentials PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationCollections>") + target_compile_options(FoundationEssentials PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") endif() -target_link_options(FoundationEssentials PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(FoundationEssentials PROPERTIES - INSTALL_RPATH "$ORIGIN") + INSTALL_RPATH "$ORIGIN" + INSTALL_REMOVE_ENVIRONMENT_RPATH ON) set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS FoundationEssentials) _swift_foundation_install_target(FoundationEssentials) diff --git a/Sources/FoundationEssentials/Predicate/PredicateExpression.swift b/Sources/FoundationEssentials/Predicate/PredicateExpression.swift index 3e8520ea8..160a00959 100644 --- a/Sources/FoundationEssentials/Predicate/PredicateExpression.swift +++ b/Sources/FoundationEssentials/Predicate/PredicateExpression.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#if FOUNDATION_FRAMEWORK +#if canImport(Synchronization) && (!canImport(Darwin) || FOUNDATION_FRAMEWORK) internal import Synchronization #endif @@ -85,14 +85,14 @@ public struct PredicateError: Error, Hashable, CustomDebugStringConvertible { extension PredicateExpressions { public struct VariableID: Hashable, Codable, Sendable { let id: UInt - #if FOUNDATION_FRAMEWORK + #if canImport(Synchronization) && (!canImport(Darwin) || FOUNDATION_FRAMEWORK) private static let nextID = Atomic(0) #else private static let nextID = LockedState(initialState: UInt(0)) #endif init() { - #if FOUNDATION_FRAMEWORK + #if canImport(Synchronization) && (!canImport(Darwin) || FOUNDATION_FRAMEWORK) self.id = Self.nextID.wrappingAdd(1, ordering: .relaxed).oldValue #else self.id = Self.nextID.withLock { value in diff --git a/Sources/FoundationInternationalization/CMakeLists.txt b/Sources/FoundationInternationalization/CMakeLists.txt index b3e6feb11..c58f42639 100644 --- a/Sources/FoundationInternationalization/CMakeLists.txt +++ b/Sources/FoundationInternationalization/CMakeLists.txt @@ -44,13 +44,13 @@ if(NOT BUILD_SHARED_LIBS) "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationCShims>") target_compile_options(FoundationInternationalization PRIVATE "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationICU>") + target_compile_options(FoundationEssentials PRIVATE + "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend swiftSynchronization>") endif() -target_link_options(FoundationInternationalization PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(FoundationInternationalization PROPERTIES - INSTALL_RPATH "$ORIGIN") + INSTALL_RPATH "$ORIGIN" + INSTALL_REMOVE_ENVIRONMENT_RPATH ON) set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS FoundationInternationalization) _swift_foundation_install_target(FoundationInternationalization) diff --git a/Sources/FoundationMacros/CMakeLists.txt b/Sources/FoundationMacros/CMakeLists.txt index bbc7bd628..0cc31c299 100644 --- a/Sources/FoundationMacros/CMakeLists.txt +++ b/Sources/FoundationMacros/CMakeLists.txt @@ -43,11 +43,9 @@ target_link_libraries(FoundationMacros PUBLIC SwiftSyntax::SwiftSyntaxBuilder ) -target_link_options(FoundationMacros PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(FoundationMacros PROPERTIES - INSTALL_RPATH "$ORIGIN") + INSTALL_RPATH "$ORIGIN" + INSTALL_REMOVE_ENVIRONMENT_RPATH ON) target_compile_options(FoundationMacros PRIVATE -parse-as-library) target_compile_options(FoundationMacros PRIVATE