summaryrefslogtreecommitdiff
path: root/lldb/tools
diff options
context:
space:
mode:
authorStefan Granitz <stefan.graenitz@gmail.com>2019-01-04 12:46:57 +0000
committerStefan Granitz <stefan.graenitz@gmail.com>2019-01-04 12:46:57 +0000
commit3decebe64966614c1c1694cf50d5d81ad8b3bf24 (patch)
tree9d775b6d537eece6eb2b152fa9eb31e128686bc2 /lldb/tools
parenta1a8768e5e3c59853000238c46805a26904dc69c (diff)
[CMake] Revised RPATH handling
Summary: If we build LLDB.framework, dependant tools need appropriate RPATHs in both locations, the build-tree (for testing) and the install-tree (for deployment). Luckily, CMake can handle it for us: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling. * In the build-tree, tools use the absolute path to the framework's actual output location. * In the install-tree, tools get a list of RPATHs to look for the framework when deployed. `LLDB_FRAMEWORK_INSTALL_DIR` is added to the `CMAKE_INSTALL_PREFIX` to change the relative location of LLDB.framework in the install-tree. If it is not empty, it will be added as an additional RPATH to all dependant tools (so they are functional in the install-tree). If it is empty, LLDB.framework goes to the root and tools will not be functional in the directory structure of the LLVM install-tree. For historical reasons `LLDB_FRAMEWORK_INSTALL_DIR` defaults to "Library/Frameworks". Reviewers: xiaobai, JDevlieghere, aprantl, clayborg Reviewed By: JDevlieghere Subscribers: ki.stfu, mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55330
Diffstat (limited to 'lldb/tools')
-rw-r--r--lldb/tools/driver/CMakeLists.txt4
-rw-r--r--lldb/tools/lldb-mi/CMakeLists.txt4
-rw-r--r--lldb/tools/lldb-vscode/CMakeLists.txt4
3 files changed, 12 insertions, 0 deletions
diff --git a/lldb/tools/driver/CMakeLists.txt b/lldb/tools/driver/CMakeLists.txt
index 5f5efd95ba3..9636e1e2c79 100644
--- a/lldb/tools/driver/CMakeLists.txt
+++ b/lldb/tools/driver/CMakeLists.txt
@@ -22,3 +22,7 @@ add_dependencies(lldb
LLDBOptionsTableGen
${tablegen_deps}
)
+
+if(LLDB_BUILD_FRAMEWORK)
+ lldb_setup_framework_rpaths_in_tool(lldb)
+endif()
diff --git a/lldb/tools/lldb-mi/CMakeLists.txt b/lldb/tools/lldb-mi/CMakeLists.txt
index f3f4c0097ef..20c031a1200 100644
--- a/lldb/tools/lldb-mi/CMakeLists.txt
+++ b/lldb/tools/lldb-mi/CMakeLists.txt
@@ -93,3 +93,7 @@ add_lldb_tool(lldb-mi
LINK_COMPONENTS
Support
)
+
+if(LLDB_BUILD_FRAMEWORK)
+ lldb_setup_framework_rpaths_in_tool(lldb-mi)
+endif()
diff --git a/lldb/tools/lldb-vscode/CMakeLists.txt b/lldb/tools/lldb-vscode/CMakeLists.txt
index f1570089a84..08511248d33 100644
--- a/lldb/tools/lldb-vscode/CMakeLists.txt
+++ b/lldb/tools/lldb-vscode/CMakeLists.txt
@@ -28,3 +28,7 @@ add_lldb_tool(lldb-vscode
LINK_COMPONENTS
Support
)
+
+if(LLDB_BUILD_FRAMEWORK)
+ lldb_setup_framework_rpaths_in_tool(lldb-vscode)
+endif()