From: Raul Tambre Date: Fri, 8 Jan 2021 17:54:52 +0000 (+0200) Subject: Revert "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath" X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=913c430403b52b9336ed93fabbac363a3e18536a;p=android-x86%2Fexternal-llvm-project.git Revert "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath" This reverts commit 0ebc1fb29f278db0665423f15c53e6ee9601dddb. The behaviour should have been the same as before unless specifying CMAKE_BUILD_RPATH, which was previously broken. However, this seems to have broken builds for some people that don't specify it. Reverting until I can investigate. Differential Revision: https://reviews.llvm.org/D94319 --- diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index dc06ea14c58..b86fbdaaa6d 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -865,13 +865,10 @@ macro(add_llvm_executable name) if(NOT ARG_NO_INSTALL_RPATH) llvm_setup_rpath(${name}) - else() - # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. - if(NOT "${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}") + elseif (LLVM_LOCAL_RPATH) + set_target_properties(${name} PROPERTIES + BUILD_WITH_INSTALL_RPATH On + INSTALL_RPATH "${LLVM_LOCAL_RPATH}") endif() if(DEFINED windows_resource_file) @@ -2116,12 +2113,8 @@ function(llvm_setup_rpath name) return() endif() - # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. - if(NOT "${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()