[PATCH] D94322: Re-land "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"
Raul Tambre via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 8 10:22:27 PST 2021
tambre created this revision.
tambre added a reviewer: phosek.
Herald added a subscriber: mgorny.
tambre requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Reverted check for empty CMAKE_BUILD_RPATH fixed.
When `BUILD_WITH_INSTALL_RPATH` is enabled it prevents using a custom rpath only
for the build tree as the install rpath will be used. This makes it impossible to run a
runtimes build when compiling with Clang and wanting the installed rpath to be
empty (i.e. `-DCMAKE_BUILD_RPATH="<some path>" -DCMAKE_SKIP_INSTALL_RPATH=ON`).
Disable `BUILD_WITH_INSTALL_RPATH` when `CMAKE_BUILD_RPATH` is non-empty to
allow for such build scenarios.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D94322
Files:
llvm/cmake/modules/AddLLVM.cmake
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -865,10 +865,13 @@
if(NOT ARG_NO_INSTALL_RPATH)
llvm_setup_rpath(${name})
- elseif (LLVM_LOCAL_RPATH)
- set_target_properties(${name} PROPERTIES
- BUILD_WITH_INSTALL_RPATH On
- INSTALL_RPATH "${LLVM_LOCAL_RPATH}")
+ else()
+ # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set.
+ if("${CMAKE_BUILD_RPATH}" STREQUAL "")
+ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
+ endif()
+
+ set_property(TARGET ${name} PROPERTY INSTALL_RPATH "${LLVM_LOCAL_RPATH}")
endif()
if(DEFINED windows_resource_file)
@@ -2113,8 +2116,12 @@
return()
endif()
+ # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set.
+ if("${CMAKE_BUILD_RPATH}" STREQUAL "")
+ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
+ endif()
+
set_target_properties(${name} PROPERTIES
- BUILD_WITH_INSTALL_RPATH On
INSTALL_RPATH "${_install_rpath}"
${_install_name_dir})
endfunction()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94322.315440.patch
Type: text/x-patch
Size: 1270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210108/33b542a4/attachment.bin>
More information about the llvm-commits
mailing list