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.
This commit is contained in:
Saleem Abdulrasool 2020-03-10 18:49:26 -07:00 committed by Brad King
parent d1cb554c99
commit f481b3a947

View File

@ -27,12 +27,14 @@ elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
endif() endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) 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 "-Xlinker -rpath -Xlinker ")
set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP ":") if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP "")
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP "")
set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") else()
set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP ":") set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP ":")
endif() endif()
endif() endif()