Skip to content

Commit

Permalink
CMake: allow customizing install_name for standard library dylibs
Browse files Browse the repository at this point in the history
<rdar://problem/23173251>

Swift SVN r32865
  • Loading branch information
gribozavr committed Oct 24, 2015
1 parent d679d9a commit de5fe48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
set(SWIFT_DARWIN_ICU_INCLUDE_PATH "" CACHE STRING
"Path to the directory where the ICU headers are located")

set(SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR "@rpath" CACHE STRING
"The directory of the install_name for standard library dylibs")

#
# User-configurable debugging options.
#
Expand Down
11 changes: 8 additions & 3 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -885,10 +885,15 @@ function(_add_swift_library_single target name)
endif()

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(install_name_dir "@rpath")
if(SWIFTLIB_SINGLE_IS_STDLIB)
set(install_name_dir "${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
endif()

set_target_properties("${target}"
PROPERTIES
INSTALL_NAME_DIR "@rpath"
BUILD_WITH_INSTALL_RPATH YES)
PROPERTIES
INSTALL_NAME_DIR "${install_name_dir}"
BUILD_WITH_INSTALL_RPATH YES)
endif()

set_target_properties("${target}" PROPERTIES FOLDER "Swift libraries")
Expand Down

0 comments on commit de5fe48

Please sign in to comment.