[Lldb-commits] [PATCH] D101903: [LLDB] Don't use the local python to set a default for LLDB_PYTHON_RELATIVE_PATH when cross compiling.
Martin Storsjö via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue May 11 04:05:35 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3f03877f5a83: [LLDB] Don't use the local python to set a default for… (authored by mstorsjo).
Changed prior to commit:
https://reviews.llvm.org/D101903?vs=343017&id=344349#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101903/new/
https://reviews.llvm.org/D101903
Files:
lldb/CMakeLists.txt
Index: lldb/CMakeLists.txt
===================================================================
--- lldb/CMakeLists.txt
+++ lldb/CMakeLists.txt
@@ -31,13 +31,22 @@
endif()
if (LLDB_ENABLE_PYTHON)
- execute_process(
- COMMAND ${Python3_EXECUTABLE}
- -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))"
- OUTPUT_VARIABLE LLDB_PYTHON_DEFAULT_RELATIVE_PATH
- OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (NOT CMAKE_CROSSCOMPILING)
+ execute_process(
+ COMMAND ${Python3_EXECUTABLE}
+ -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))"
+ OUTPUT_VARIABLE LLDB_PYTHON_DEFAULT_RELATIVE_PATH
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ file(TO_CMAKE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH} LLDB_PYTHON_DEFAULT_RELATIVE_PATH)
+ else ()
+ if ("${LLDB_PYTHON_RELATIVE_PATH}" STREQUAL "")
+ message(FATAL_ERROR
+ "Crosscompiling LLDB with Python requires manually setting
+ LLDB_PYTHON_RELATIVE_PATH.")
+ endif ()
+ endif ()
- file(TO_CMAKE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH} LLDB_PYTHON_DEFAULT_RELATIVE_PATH)
set(LLDB_PYTHON_RELATIVE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH}
CACHE STRING "Path where Python modules are installed, relative to install prefix")
endif ()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101903.344349.patch
Type: text/x-patch
Size: 1328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210511/59944e0c/attachment.bin>
More information about the lldb-commits
mailing list