diff options
| author | Zachary Turner <zturner@google.com> | 2015-04-10 22:58:56 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2015-04-10 22:58:56 +0000 |
| commit | dd50f7421cebbbdf6ba0a5116e40329d6522c9e6 (patch) | |
| tree | 42a07c7941af7c17c489d45cb0a0b7465ed5626e /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
| parent | 1290047a7d70b304114127dbcabe5f79dbca325e (diff) | |
Making linking against Python simpler on Windows.
This patch deprecates the three Python CMake variables in favor of
a single variable PYTHON_HOME which points to the root of a python
installation. Since building Python doesn't output the files in
a structure that is compatible with the PYTHONHOME environment
variable, we also provide a script install_custom_python.py which
will copy the output of a custom python build to the correct
directory structure.
The supported workflow after this patch will be to build python
once for each configuration and architecture {Debug,Release} x {x86,x64}
and then run the script. Then run CMake specifying -DPYTHON_HOME=<path>
The first time you do this will probably require you to delete your
CMake cache.
The old workflow is still supported during a transitionary period,
but a warning is printed at CMake time, and this will eventually
be removed.
Differential Revision: http://reviews.llvm.org/D8979
llvm-svn: 234660
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
| -rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 099cbaa0cedd..7ecef310b5c3 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -3024,6 +3024,9 @@ ScriptInterpreterPython::InitializePrivate () TerminalState stdin_tty_state; stdin_tty_state.Save(STDIN_FILENO, false); +#if defined(LLDB_PYTHON_HOME) + Py_SetPythonHome(LLDB_PYTHON_HOME); +#endif PyGILState_STATE gstate; Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_SCRIPT | LIBLLDB_LOG_VERBOSE)); bool threads_already_initialized = false; |
