diff options
author | Haibo Huang <hhb@google.com> | 2019-09-16 23:31:16 +0000 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2019-09-16 16:37:20 -0700 |
commit | 60aaffe353336fcd5afa08a24133df6673dee3f5 (patch) | |
tree | 51bd6e070c7db2ead923136198d3303047895a05 | |
parent | fe11d50587a8ddaee49e66dc7a6a982e85b82424 (diff) | |
download | llvm-project-android-s-v2-beta-3.tar.gz |
[Upstream] Fix swig python package pathHEADandroid-t-preview-2android-t-preview-1android-t-beta-3android-s-v2-preview-2android-s-v2-preview-1android-s-v2-beta-3android-s-v2-beta-2android-s-qpr3-beta-1android-s-beta-5masterandroid-t-preview-1android-s-v2-preview-1android-s-v2-beta-3android-s-qpr3-beta-1android-s-beta-5
Summary:
The path defined in CMakeLists.txt doesn't match the path generated in
our python script. This change fixes that.
LLVM_LIBRARY_OUTPUT_INTDIR is defined as:
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
On the other hand, the path of site-package is generaged in
get_framework_python_dir_windows() in finishSwigPythonLLDB.py as:
(Dispite its name, the function is used for everything other than xcode)
prefix/cmakeBuildConfiguration/distutils.sysconfig.get_python_lib()
From lldb/CMakeLists.txt, we can see that:
prefix=${CMAKE_BINARY_DIR},
cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}
And from python source code, we can see get_python_lib() always returns
lib/pythonx.y/site-packages for posix, or Lib/site-packages for windows:
https://github.com/python/cpython/blob/3.8/Lib/distutils/sysconfig.py#L128
We should make them match each other.
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D67583
Change-Id: Ide4c809e00fa91feb47b899e9494d94773ae79e8
llvm-svn: 372047
-rw-r--r-- | lldb/scripts/CMakeLists.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/scripts/CMakeLists.txt b/lldb/scripts/CMakeLists.txt index 3598247dd619..c06afbd442c9 100644 --- a/lldb/scripts/CMakeLists.txt +++ b/lldb/scripts/CMakeLists.txt @@ -40,13 +40,15 @@ add_custom_target(swig_wrapper ALL DEPENDS ) if(NOT LLDB_BUILD_FRAMEWORK) - if(CMAKE_SYSTEM_NAME MATCHES "Windows") - set(swig_python_subdir site-packages) + # The path here should match the result of python function + # distutils.sysconfig.get_python_lib(). + if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") + set(swig_python_subdir Lib/site-packages) else() - set(swig_python_subdir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) + set(swig_python_subdir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) endif() - set(SWIG_PYTHON_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${swig_python_subdir}) + set(SWIG_PYTHON_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${swig_python_subdir}) set(SWIG_INSTALL_DIR lib${LLVM_LIBDIR_SUFFIX}) # Install the LLDB python module |