summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/finishSwigPythonLLDB.py
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-07-17 20:36:14 +0000
committerZachary Turner <zturner@google.com>2014-07-17 20:36:14 +0000
commitfa59e620126114e35477299dbb726c4e85195276 (patch)
treec36dfcb8c041f6ac31696ca3b10bf112a956f5c3 /lldb/scripts/Python/finishSwigPythonLLDB.py
parent9a08847e6de438628c63f4306a85718063ca8f17 (diff)
downloadbcm5719-llvm-fa59e620126114e35477299dbb726c4e85195276.tar.gz
bcm5719-llvm-fa59e620126114e35477299dbb726c4e85195276.zip
Create an _d suffixed symlink when doing a debug Windows build.
_lldb is built as an extension module on Windows. Normally to load an extension module named 'foo', Python would look for the file 'foo.pyd'. However, when a debug interpreter is used, Python will look for the file 'foo_d.pyd'. This change checks the build configuration and creates the correct symlink name based on the build configuration. llvm-svn: 213306
Diffstat (limited to 'lldb/scripts/Python/finishSwigPythonLLDB.py')
-rw-r--r--lldb/scripts/Python/finishSwigPythonLLDB.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/scripts/Python/finishSwigPythonLLDB.py b/lldb/scripts/Python/finishSwigPythonLLDB.py
index a2e35c5b5fb..f17b9159681 100644
--- a/lldb/scripts/Python/finishSwigPythonLLDB.py
+++ b/lldb/scripts/Python/finishSwigPythonLLDB.py
@@ -235,7 +235,13 @@ def make_symlink_windows( vDictArgs, vstrFrameworkPythonDir, vstrDllName ):
strMsg = "";
bDbg = vDictArgs.has_key( "-d" );
- strTarget = vstrDllName + ".pyd";
+ strTarget = vstrDllName;
+ # When importing an extension module using a debug version of python, you
+ # write, for example, "import foo", but the interpreter searches for
+ # "foo_d.pyd"
+ if vDictArgs["--buildConfig"].lower() == "debug":
+ strTarget += "_d";
+ strTarget += ".pyd";
strDLLPath = "%s\\%s" % (vstrFrameworkPythonDir, strTarget);
strTarget = os.path.normcase( strDLLPath );
strSrc = "";
@@ -525,6 +531,7 @@ def get_framework_python_dir( vDictArgs ):
-m (optional) Specify called from Makefile system. If given locate
the LLDBWrapPython.cpp in --srcRoot/source folder
else in the --targetDir folder.
+ --buildConfig The LLDB build configuration (e.g. debug/release).
--srcRoot The root of the lldb source tree.
--targetDir Where the lldb framework/shared library gets put.
--cfgBlddir Where the buildSwigPythonLLDB.py program will
OpenPOWER on IntegriCloud