summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-10-30 18:08:26 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-30 18:18:15 (GMT)
commit1e05f89f4b77f3610122b54d272a41966bf24a72 (patch)
tree2a0be399583b30ff79323033eaaa973a7338653c
parent92780281c2e8a46223b262b152caa9c8329373b1 (diff)
downloadCMake-1e05f89f4b77f3610122b54d272a41966bf24a72.zip
CMake-1e05f89f4b77f3610122b54d272a41966bf24a72.tar.gz
CMake-1e05f89f4b77f3610122b54d272a41966bf24a72.tar.bz2
Swift: support `BUILD_RPATH` properties
Enable passing a RPATH to Swift shared libraries. This enables testing libraries before they have been installed.
-rw-r--r--Modules/CMakeSwiftInformation.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 4f1d4f0..c13c03f 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -24,6 +24,10 @@ elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ")
endif()
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ")
+endif()
+
set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ")
set(CMAKE_Swift_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN "-tools-directory ")
# NOTE(compnerd) the `-sdk` support is not yet ready in the compiler; when that