Skip to content

Commit

Permalink
Use analogous rpath settings for Swift libraries on Linux
Browse files Browse the repository at this point in the history
This was defaulting to the build directory, which isn't helpful
post-install. Set Swift libraries to look in the same directory
(ORIGIN) or /usr/lib/swift/linux.

rdar://problem/22766758
  • Loading branch information
bitjammer committed Nov 13, 2015
1 parent 59092a3 commit ad95b5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -888,10 +888,14 @@ function(_add_swift_library_single target name)

set_target_properties("${target}"
PROPERTIES
INSTALL_NAME_DIR "${install_name_dir}"
BUILD_WITH_INSTALL_RPATH YES)
INSTALL_NAME_DIR "${install_name_dir}")
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set_target_properties("${target}"
PROPERTIES
INSTALL_RPATH "$ORIGIN:/usr/lib/swift/linux")
endif()

set_target_properties("${target}" PROPERTIES BUILD_WITH_INSTALL_RPATH YES)
set_target_properties("${target}" PROPERTIES FOLDER "Swift libraries")

# Configure the static library target.
Expand Down

0 comments on commit ad95b5f

Please sign in to comment.