[Lldb-commits] [PATCH] D67890: [lldb] [cmake] Fix installing Python modules on systems using /usr/lib

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 23 06:08:03 PDT 2019


labath added inline comments.


================
Comment at: lldb/scripts/CMakeLists.txt:45-50
+  execute_process(
+    COMMAND ${PYTHON_EXECUTABLE}
+        -c "import distutils.sysconfig, sys; print(distutils.sysconfig.get_python_lib(True, False, sys.argv[1]))"
+        ${CMAKE_BINARY_DIR}
+    OUTPUT_VARIABLE SWIG_PYTHON_DIR
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
----------------
mgorny wrote:
> labath wrote:
> > For my own education, is it possible that the result of the `get_python_lib` call will fundamentally differ depending on the value of the third argument. I.e., is there any case where `${SWIG_PYTHON_DIR}` will be different from `${CMAKE_BINARY_DIR}/${SWIG_INSTALL_DIR}` ?
> The former will be an absolute path while the latter is just the relative path. But if you mean whether they could have a different tail: I don't think so, at least with CPython. PyPy had some nasty logic, so I'd have to check if we ever decided to support that.
Right now that doesn't matter, but I am thinking ahead about the cross-compilation case. If we turn out to need a cache variable for this, it would be nice if it would be a single variable that the user could set (instead of two of them). For that to work, we'd need to be able to compute the result of one of these calls using the value of the other one.


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

https://reviews.llvm.org/D67890





More information about the lldb-commits mailing list