From f481b3a947eaaae853c3e1675ba824246204c284 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 10 Mar 2020 18:49:26 -0700 Subject: [PATCH] Swift: repair RPATH handling for macOS The configuration previously handled Linux properly but did not function on macOS as `ld64` does not support `:` delimited paths. Account for that by setting it to the empty string which will use multiple invocations of the `-Xlinker -rpath -Xlinker ...` pattern to compute the correct RPATH. --- Modules/CMakeSwiftInformation.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index ba242ec278..8f0909c997 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -27,12 +27,14 @@ elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) endif() if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) + set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") 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 ") + if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP "") + set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP "") + else() set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP ":") + set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP ":") endif() endif()