)
if(NOT LLDB_BUILD_FRAMEWORK)
- if(CMAKE_SYSTEM_NAME MATCHES "Windows")
- set(swig_python_subdir site-packages)
- else()
- set(swig_python_subdir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
- endif()
-
- set(SWIG_PYTHON_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${swig_python_subdir})
- set(SWIG_INSTALL_DIR lib${LLVM_LIBDIR_SUFFIX})
+ 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)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE}
+ -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))"
+ OUTPUT_VARIABLE SWIG_INSTALL_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
# Install the LLDB python module
- install(DIRECTORY ${SWIG_PYTHON_DIR} DESTINATION ${SWIG_INSTALL_DIR})
+ install(DIRECTORY ${SWIG_PYTHON_DIR}/ DESTINATION ${SWIG_INSTALL_DIR})
endif()
# right answer always.
arch_specific_libdir = distutils.sysconfig.get_python_lib(True, False)
split_libdir = arch_specific_libdir.split(os.sep)
- lib_re = re.compile(r"^lib.+$")
+ lib_re = re.compile(r"^lib.*$")
for i in range(len(split_libdir)):
match = lib_re.match(split_libdir[i])