diff --git a/Sources/Foundation/CMakeLists.txt b/Sources/Foundation/CMakeLists.txt index f138c8f2ba..dda85d6759 100644 --- a/Sources/Foundation/CMakeLists.txt +++ b/Sources/Foundation/CMakeLists.txt @@ -157,6 +157,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows) add_dependencies(Foundation CoreFoundationResources) target_link_options(Foundation PRIVATE $) +elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) + target_link_options(Foundation PRIVATE "SHELL:-no-toolchain-stdlib-rpath") endif() diff --git a/Sources/FoundationNetworking/CMakeLists.txt b/Sources/FoundationNetworking/CMakeLists.txt index b6475b5442..2a571f4a24 100644 --- a/Sources/FoundationNetworking/CMakeLists.txt +++ b/Sources/FoundationNetworking/CMakeLists.txt @@ -68,6 +68,10 @@ set_target_properties(FoundationNetworking PROPERTIES Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift) +if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows") + target_link_options(FoundationNetworking PRIVATE "SHELL:-no-toolchain-stdlib-rpath") +endif() + set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationNetworking) _install_target(FoundationNetworking) diff --git a/Sources/FoundationXML/CMakeLists.txt b/Sources/FoundationXML/CMakeLists.txt index a3200322a9..4ca963a3dd 100644 --- a/Sources/FoundationXML/CMakeLists.txt +++ b/Sources/FoundationXML/CMakeLists.txt @@ -20,6 +20,10 @@ set_target_properties(FoundationXML PROPERTIES Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift) +if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows") + target_link_options(FoundationXML PRIVATE "SHELL:-no-toolchain-stdlib-rpath") +endif() + set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML) _install_target(FoundationXML)