[PATCH] D94319: Revert "[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 09:58:57 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.

This reverts commit 0ebc1fb29f278db0665423f15c53e6ee9601dddb <https://reviews.llvm.org/rG0ebc1fb29f278db0665423f15c53e6ee9601dddb>.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94319

Files:
  llvm/cmake/modules/AddLLVM.cmake


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94319.315429.patch
Type: text/x-patch
Size: 1278 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210108/e007ee8f/attachment.bin>


More information about the llvm-commits mailing list