diff options
author | Zachary Turner <zturner@google.com> | 2015-04-22 22:53:18 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-04-22 22:53:18 +0000 |
commit | 0405d68bb472f208ef660ad69682fe1b54a58804 (patch) | |
tree | 2876555eb36278da7172ceae9bdd11815a15b0b7 /lldb/scripts/Python/finishSwigPythonLLDB.py | |
parent | 7d0e99c6019ca1c4c6708309ef5dade0db03b425 (diff) | |
download | llvm-0405d68bb472f208ef660ad69682fe1b54a58804.zip llvm-0405d68bb472f208ef660ad69682fe1b54a58804.tar.gz llvm-0405d68bb472f208ef660ad69682fe1b54a58804.tar.bz2 |
Use the debugginess of the python interpreter when symlinking _lldb.pyd.
Previously we would pass an argument to finishSwigWrapperClasses.py which
specified whether this was a debug or a release build. But sometimes
CMAKE_BUILD_TYPE would not be set to anything, causing this argument
to be empty when passed in. The only purpose of this argument was to
determine whether or not to append _d to the extension module when
creating the symlink. This is only necessary when doing a debug
build of LLDB on Windows, which implies a debug interpreter, so we
replace this with a check to see if the running interpreter is a debug
one, and append _d if so.
llvm-svn: 235559
Diffstat (limited to 'lldb/scripts/Python/finishSwigPythonLLDB.py')
-rw-r--r-- | lldb/scripts/Python/finishSwigPythonLLDB.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/scripts/Python/finishSwigPythonLLDB.py b/lldb/scripts/Python/finishSwigPythonLLDB.py index c9b5e81..30759b5 100644 --- a/lldb/scripts/Python/finishSwigPythonLLDB.py +++ b/lldb/scripts/Python/finishSwigPythonLLDB.py @@ -73,6 +73,9 @@ strErrMsgMkLinkExecute = "Command mklink failed: %s"; strErrMsgMakeSymlink = "creating symbolic link"; strErrMsgUnexpected = "Unexpected error: %s"; +def is_debug_interpreter(): + return hasattr(sys, 'gettotalrefcount') + #++--------------------------------------------------------------------------- # Details: Copy files needed by lldb/macosx/heap.py to build libheap.dylib. # Args: vDictArgs - (R) Program input parameters. @@ -348,7 +351,7 @@ def make_symlink_liblldb( vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName # 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": + if is_debug_interpreter(): strTarget += "_d"; strTarget += ".pyd"; else: @@ -640,7 +643,6 @@ 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 |