[llvm-branch-commits] [llvm] 840a2c9 - [CMake] Fix incorrect rpath for tests if LLVM_LOCAL_RPATH isn't set

Raul Tambre via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jan 8 11:28:43 PST 2021


Author: Raul Tambre
Date: 2021-01-08T21:24:18+02:00
New Revision: 840a2c978374ccc74a0e0b2576c1027fdb609a59

URL: https://github.com/llvm/llvm-project/commit/840a2c978374ccc74a0e0b2576c1027fdb609a59
DIFF: https://github.com/llvm/llvm-project/commit/840a2c978374ccc74a0e0b2576c1027fdb609a59.diff

LOG: [CMake] Fix incorrect rpath for tests if LLVM_LOCAL_RPATH isn't set

d9ce31ae7d (D94322) removed the check because I thought it was dead
due to checking the existance of a variable (which always existed).

This causes LLDB tests to fail as they set NO_INSTALL_RPATH because
they're never meant to be installed, but we still would end up using
the install rpath.

Add the check back and make it explicitly check for an empty value
to make the purpose clearer and avoid implicit test for a false/true
value.

Differential Revision: https://reviews.llvm.org/D94326

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 17b3ad381ea6..97c9980c7de3 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -865,7 +865,7 @@ macro(add_llvm_executable name)
 
   if(NOT ARG_NO_INSTALL_RPATH)
     llvm_setup_rpath(${name})
-  else()
+  elseif(NOT "${LLVM_LOCAL_RPATH}" STREQUAL "")
     # 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)


        


More information about the llvm-branch-commits mailing list