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

Raul Tambre via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 11:24:08 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.

d9ce31ae7d <https://reviews.llvm.org/rGd9ce31ae7d1fc68de0ea1535fd25ef84e69aeb07> (D94322 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94326

Files:
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -865,7 +865,7 @@
 
   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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94326.315464.patch
Type: text/x-patch
Size: 515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210108/98e9d113/attachment.bin>


More information about the llvm-commits mailing list