[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:08 PST 2019


MaskRay updated this revision to Diff 235170.
MaskRay marked 3 inline comments as done.
MaskRay retitled this revision from "[CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS AND UNIX" to "[CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_DYLIB on *nix".
MaskRay edited the summary of this revision.
MaskRay added a comment.

Make -DLLVM_LINK_LLVM_DYLIB=ON work


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71800

Files:
  lldb/source/API/CMakeLists.txt


Index: lldb/source/API/CMakeLists.txt
===================================================================
--- lldb/source/API/CMakeLists.txt
+++ lldb/source/API/CMakeLists.txt
@@ -111,6 +111,14 @@
   ${option_install_prefix}
 )
 
+# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
+# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so
+# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so
+# that _lldb.so can be loaded from Python.
+if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE)
+  set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}")
+endif()
+
 if (MSVC)
   set_source_files_properties(SBReproducer.cpp PROPERTIES COMPILE_FLAGS /bigobj)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71800.235170.patch
Type: text/x-patch
Size: 827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191223/9a4faa20/attachment.bin>


More information about the lldb-commits mailing list