Before this change, the procedure of installing and loading python
modules are as follow:
- finishSwigPythonLLDB.py writes necessary files to
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/distutils.sysconfig.get_python_lib()
- lldb/scripts/CMakeLists.txt installs them to lib${LLVM_LIBDIR_SUFFIX}
- ScriptInterpreterPython.cpp adds the right path into PYTHONPATH.
(XCode is using a different path but that's not changed here.)
The issue is that get_python_lib() is platform dependent. It is
difficult to guess the right path in cmake. And it is impossible to be
right when cross compiling.
This change updates finishSwigPythonLLDB.py to output to ${liblldb_build_dir}.
Since cmake will always install them into lib${LLVM_LIBDIR_SUFFIX} , this change
Also updates ScriptInterpreterPython.cpp to load from
${liblldb_path}/../lib${LLVM_LIBDIR_SUFFIX}/site-packages.