File tree 3 files changed +43
-2
lines changed 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ if (WIN32)
35
35
add_definitions (-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
36
36
endif ()
37
37
38
+ if (NOT LLDB_DISABLE_PYTHON)
39
+ execute_process (
40
+ COMMAND
41
+ ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /scripts/get_libdir_suffix.py
42
+ OUTPUT_VARIABLE LLDB_PY_LIB_SUFFIX)
43
+ endif ()
44
+
45
+ add_subdirectory (docs)
38
46
if (NOT LLDB_DISABLE_PYTHON)
39
47
add_subdirectory (scripts)
40
48
endif ()
@@ -202,7 +210,7 @@ if (NOT LLDB_DISABLE_PYTHON)
202
210
--cfgBldDir=${lldb_scripts_dir}
203
211
--prefix =${CMAKE_BINARY_DIR}
204
212
--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}
205
- --lldbLibDir=lib${LLVM_LIBDIR_SUFFIX }
213
+ --lldbLibDir=lib${LLDB_PY_LIB_SUFFIX }
206
214
${use_python_wrapper_from_src_dir}
207
215
${use_six_py_from_system}
208
216
VERBATIM
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ if(NOT LLDB_BUILD_FRAMEWORK)
49
49
endif ()
50
50
51
51
set (SWIG_PYTHON_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR} /${swig_python_subdir} )
52
- set (SWIG_INSTALL_DIR lib${LLVM_LIBDIR_SUFFIX } )
52
+ set (SWIG_INSTALL_DIR lib${LLDB_PY_LIB_SUFFIX } )
53
53
54
54
# Install the LLDB python module
55
55
install (DIRECTORY ${SWIG_PYTHON_DIR} DESTINATION ${SWIG_INSTALL_DIR} )
Original file line number Diff line number Diff line change
1
+ import distutils .sysconfig
2
+ import os
3
+ import platform
4
+ import re
5
+ import sys
6
+
7
+
8
+ def get_python_libdir_suffix ():
9
+ """Returns the appropropriate python libdir suffix.
10
+
11
+ @return the python libdir suffix, normally either "" or "64".
12
+ """
13
+ if platform .system () != 'Linux' :
14
+ return ""
15
+
16
+ # We currently have a bug in lldb -P that does not account for
17
+ # architecture variants in python paths for
18
+ # architecture-specific modules. Handle the lookup here.
19
+ # When that bug is fixed, we should just ask lldb for the
20
+ # right answer always.
21
+ arch_specific_libdir = distutils .sysconfig .get_python_lib (True , False )
22
+ split_libdir = arch_specific_libdir .split (os .sep )
23
+ lib_re = re .compile (r"^lib.+$" )
24
+
25
+ for i in range (len (split_libdir )):
26
+ match = lib_re .match (split_libdir [i ])
27
+ if match is not None :
28
+ return split_libdir [i ][3 :]
29
+ return ""
30
+
31
+ if __name__ == '__main__' :
32
+ sys .stdout .write (get_python_libdir_suffix ())
33
+ sys .exit (0 )
You can’t perform that action at this time.
0 commit comments