summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeSwiftInformation.cmake
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2020-02-15 19:17:58 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-17 16:07:40 (GMT)
commit321df5783d3a3d4708ce428b471254e63d9bdf5b (patch)
tree0b1d2b520974c4fb23953afcecc265748c7fdb3a /Modules/CMakeSwiftInformation.cmake
parent125f0451a9061c60036c5f92d104ee9fb3111a98 (diff)
downloadCMake-321df5783d3a3d4708ce428b471254e63d9bdf5b.zip
CMake-321df5783d3a3d4708ce428b471254e63d9bdf5b.tar.gz
CMake-321df5783d3a3d4708ce428b471254e63d9bdf5b.tar.bz2
Swift: support `-rpath` for executables
This adjusts the flags to enable setting the RPATH for executables.
Diffstat (limited to 'Modules/CMakeSwiftInformation.cmake')
-rw-r--r--Modules/CMakeSwiftInformation.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 848934c..ba242ec 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -29,6 +29,11 @@ endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ")
set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP ":")
+
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
+ set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ")
+ set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP ":")
+ endif()
endif()
set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ")