From fa59e620126114e35477299dbb726c4e85195276 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Thu, 17 Jul 2014 20:36:14 +0000 Subject: 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 --- lldb/scripts/Python/finishSwigPythonLLDB.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lldb/scripts/Python') 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 -- cgit v1.2.3