From ee91d59a3d80732fdf9bf07757dbd84e120b1fe8 Mon Sep 17 00:00:00 2001 From: Butta Date: Wed, 6 May 2020 12:06:09 +0530 Subject: [PATCH] [CMake] fix runpath for ELF platforms Remove the absolute path to the host toolchain's stdlib from libXCTest.so. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index aeefa9be1..687fb0c08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,9 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) target_link_libraries(XCTest PRIVATE dispatch Foundation) + if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) + target_link_options(XCTest PRIVATE "SHELL:-no-toolchain-stdlib-rpath") + endif() endif() set_target_properties(XCTest PROPERTIES Swift_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swift