summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-11-01 17:44:58 +0000
committerChris Bieneman <beanz@apple.com>2016-11-01 17:44:58 +0000
commit3a876bdaec4dd8e43d21e0ce369f17db274431c0 (patch)
treef807b1a19a0f7b9e742ecaeeea29508c12121ad9 /CMakeLists.txt
parentee817c2c9606519d6d3eb04ef60a64c6b3afed83 (diff)
[CMake] Fix rpath construction for out-of-tree builds
This patch was produced in conjunction with Michał Górny. It should resolve the issues that were trying to be solved by D25304. This moves rpath handling into `llvm_add_library` and `add_llvm_executable` so that it is available to all projects using AddLLVM whether built in-tree or out-of-tree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 0 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb1055ab989..1b7fe83e65a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -677,20 +677,6 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
-set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
-if (APPLE)
- set(CMAKE_INSTALL_NAME_DIR "@rpath")
- set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
-else(UNIX)
- if(NOT DEFINED CMAKE_INSTALL_RPATH)
- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
- if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,origin")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,origin")
- endif()
- endif(NOT DEFINED CMAKE_INSTALL_RPATH)
-endif()
-
if(APPLE AND DARWIN_LTO_LIBRARY)
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")