[Lldb-commits] [PATCH] D71800: [CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_DYLIB on *nix

Fangrui Song via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 23 11:42:10 PST 2019


MaskRay added inline comments.


================
Comment at: lldb/source/API/CMakeLists.txt:117
+# loaded from Python.
+if(LLDB_ENABLE_PYTHON AND BUILD_SHARED_LIBS AND UNIX)
+  if(LLVM_INSTALL_PREFIX AND NOT (LLVM_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX))
----------------
labath wrote:
> I think this would work on APPLE (which is subsumed by UNIX). Though I don't know if anyone there actually uses BUILD_SHARED_LIBS...
I assume APPLE -DBUILD_SHARED_LIBS=On works as-is. I will add `AND NOT APPLE`.


================
Comment at: lldb/source/API/CMakeLists.txt:124
+  set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+  set_target_properties(liblldb PROPERTIES INSTALL_RPATH "${_install_rpath}")
+endif()
----------------
labath wrote:
> MaskRay wrote:
> > The extra_libdir logic is copied from `llvm/cmake/modules/AddLLVM.cmake` `llvm_setup_rpath`.
> Instead of copying that you should do something like `set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "whatever")` to just add the new entry.
> 
Thanks for the suggestion! Will apply.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71800/new/

https://reviews.llvm.org/D71800





More information about the lldb-commits mailing list