diff --git a/Sources/FoundationEssentials/CMakeLists.txt b/Sources/FoundationEssentials/CMakeLists.txt index df86c256d..dd7563075 100644 --- a/Sources/FoundationEssentials/CMakeLists.txt +++ b/Sources/FoundationEssentials/CMakeLists.txt @@ -79,11 +79,9 @@ if(NOT BUILD_SHARED_LIBS) "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationCollections>") 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..3255e6a09 100644 --- a/Sources/FoundationInternationalization/CMakeLists.txt +++ b/Sources/FoundationInternationalization/CMakeLists.txt @@ -46,11 +46,9 @@ if(NOT BUILD_SHARED_LIBS) "SHELL:$<$:-Xfrontend -public-autolink-library -Xfrontend _FoundationICU>") 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