diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/CMakeLists.txt | 12 | ||||
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt index d319ec4aed4..c697b81a8c2 100644 --- a/lldb/source/CMakeLists.txt +++ b/lldb/source/CMakeLists.txt @@ -327,6 +327,18 @@ endif () # FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only # revision parsing solution in tools/clang/lib/Basic/CMakelists.txt. +if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION ) + # Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows) + if ( NOT LLDB_DISABLE_PYTHON ) + message("Adding post build step to run finishSwigWrapperClasses.py") + add_custom_command( TARGET liblldb + POST_BUILD + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py + COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts" "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" -m + COMMENT "Python script sym-linking LLDB Python API") + endif () +endif () + install(TARGETS liblldb RUNTIME DESTINATION bin LIBRARY DESTINATION lib diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 8120c4b3562..5803fe7be25 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -2621,7 +2621,7 @@ ScriptInterpreterPython::InitializePrivate () } } - PyRun_SimpleString ("sys.dont_write_bytecode = 1; import lldb.embedded_interpreter; from lldb.embedded_interpreter import run_python_interpreter; from lldb.embedded_interpreter import run_one_line; from termios import *"); + PyRun_SimpleString ("sys.dont_write_bytecode = 1; import lldb.embedded_interpreter; from lldb.embedded_interpreter import run_python_interpreter; from lldb.embedded_interpreter import run_one_line"); if (threads_already_initialized) { if (log) |