From 321df5783d3a3d4708ce428b471254e63d9bdf5b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 15 Feb 2020 11:17:58 -0800 Subject: Swift: support `-rpath` for executables This adjusts the flags to enable setting the RPATH for executables. --- Modules/CMakeSwiftInformation.cmake | 5 +++++ 1 file changed, 5 insertions(+) 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 ") -- cgit v0.12