diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2020-02-15 19:17:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-02-17 16:07:40 (GMT) |
commit | 321df5783d3a3d4708ce428b471254e63d9bdf5b (patch) | |
tree | 0b1d2b520974c4fb23953afcecc265748c7fdb3a | |
parent | 125f0451a9061c60036c5f92d104ee9fb3111a98 (diff) | |
download | CMake-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.
-rw-r--r-- | Modules/CMakeSwiftInformation.cmake | 5 |
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 ") |