[Lldb-commits] [lldb] 8539588 - [lldb/CMake] Set the PYTHON_RPATH for the unit tests
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 30 11:05:56 PDT 2020
Author: Jonas Devlieghere
Date: 2020-04-30T11:05:50-07:00
New Revision: 85395887837bd99689001404adcb08cd1e594cc0
URL: https://github.com/llvm/llvm-project/commit/85395887837bd99689001404adcb08cd1e594cc0
DIFF: https://github.com/llvm/llvm-project/commit/85395887837bd99689001404adcb08cd1e594cc0.diff
LOG: [lldb/CMake] Set the PYTHON_RPATH for the unit tests
The API and Python script interpreter unit tests also link against
Python and therefore need to set the RPATH when applicable.
Added:
Modified:
lldb/source/API/CMakeLists.txt
lldb/tools/lldb-test/CMakeLists.txt
lldb/unittests/API/CMakeLists.txt
lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt
Removed:
################################################################################
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index ae6f2e8e3251..e1371fd71c02 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -121,7 +121,7 @@ if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX A
endif()
if(PYTHON_RPATH)
- set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${PYTHON_RPATH}")
+ set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
endif()
if (MSVC)
diff --git a/lldb/tools/lldb-test/CMakeLists.txt b/lldb/tools/lldb-test/CMakeLists.txt
index 60b4a7ca8f70..8574150ab918 100644
--- a/lldb/tools/lldb-test/CMakeLists.txt
+++ b/lldb/tools/lldb-test/CMakeLists.txt
@@ -25,7 +25,7 @@ add_lldb_tool(lldb-test
)
if(PYTHON_RPATH)
- set_property(TARGET lldb-test APPEND PROPERTY INSTALL_RPATH "${PYTHON_RPATH}")
+ set_property(TARGET lldb-test APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
endif()
target_include_directories(lldb-test PRIVATE ${LLDB_SOURCE_DIR}/source)
diff --git a/lldb/unittests/API/CMakeLists.txt b/lldb/unittests/API/CMakeLists.txt
index 6f71165a8a70..308249b63add 100644
--- a/lldb/unittests/API/CMakeLists.txt
+++ b/lldb/unittests/API/CMakeLists.txt
@@ -4,3 +4,7 @@ add_lldb_unittest(APITests
LINK_LIBS
liblldb
)
+
+if(PYTHON_RPATH)
+ set_property(TARGET APITests APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
+endif()
diff --git a/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt b/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt
index 471f4c6dbc35..913bd629526d 100644
--- a/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt
+++ b/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt
@@ -8,4 +8,8 @@ add_lldb_unittest(ScriptInterpreterPythonTests
LLVMTestingSupport
LINK_COMPONENTS
Support
- )
\ No newline at end of file
+ )
+
+if(PYTHON_RPATH)
+ set_property(TARGET ScriptInterpreterPythonTests APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
+endif()
\ No newline at end of file
More information about the lldb-commits
mailing list