diff options
author | Haibo Huang <hhb@google.com> | 2019-10-07 23:49:01 +0000 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2019-10-07 23:49:01 +0000 |
commit | 61f471a705a5df3d581ba4905337f433bac3ba1f (patch) | |
tree | e9b2f65b0e30300541d8fcefa733d2f6009b6729 /lldb/scripts/finishSwigWrapperClasses.py | |
parent | f4c7345b88f8ca56ee350a4a0dbfee7e2db79839 (diff) | |
download | bcm5719-llvm-61f471a705a5df3d581ba4905337f433bac3ba1f.tar.gz bcm5719-llvm-61f471a705a5df3d581ba4905337f433bac3ba1f.zip |
[lldb] Unifying lldb python path
Based on mgorny@'s D67890
There are 3 places where python site-package path is calculated
independently:
1. finishSwigPythonLLDB.py where files are written to site-packages.
2. lldb/scripts/CMakeLists.txt where site-packages are installed.
3. ScriptInterpreterPython.cpp where site-packages are added to
PYTHONPATH.
This change creates the path once and use it everywhere. So that they
will not go out of sync.
Also it provides a chance for cross compiling users to specify the right
path for site-packages.
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68442
llvm-svn: 373991
Diffstat (limited to 'lldb/scripts/finishSwigWrapperClasses.py')
-rw-r--r-- | lldb/scripts/finishSwigWrapperClasses.py | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lldb/scripts/finishSwigWrapperClasses.py b/lldb/scripts/finishSwigWrapperClasses.py index 4d08b86e9e4..7e9166bf75e 100644 --- a/lldb/scripts/finishSwigWrapperClasses.py +++ b/lldb/scripts/finishSwigWrapperClasses.py @@ -179,6 +179,7 @@ def validate_arguments(vArgv): "prefix=", "cmakeBuildConfiguration=", "lldbLibDir=", + "lldbPythonPath=", "argsFile", "useSystemSix"] dictArgReq = {"-h": "o", # o = optional, m = mandatory @@ -191,7 +192,8 @@ def validate_arguments(vArgv): "--cmakeBuildConfiguration": "o", "--lldbLibDir": "o", "--argsFile": "o", - "--useSystemSix": "o"} + "--useSystemSix": "o", + "--lldbPythonPath": "m"} # Check for mandatory parameters nResult, dictArgs, strMsg = utilsArgsParse.parse(vArgv, strListArgs, @@ -293,11 +295,9 @@ def run_post_process_for_each_script_supported(vDictArgs): # Iterate script directory find any script language directories for scriptLang in listDirs: - # __pycache__ is a magic directory in Python 3 that holds .pyc files - if scriptLang != "__pycache__" and scriptLang != "swig_bot_lib": - dbg.dump_text("Executing language script for \'%s\'" % scriptLang) - nResult, strStatusMsg = run_post_process( - scriptLang, strFinishFileName, vDictArgs) + dbg.dump_text("Executing language script for \'%s\'" % scriptLang) + nResult, strStatusMsg = run_post_process( + scriptLang, strFinishFileName, vDictArgs) if nResult < 0: break @@ -337,13 +337,6 @@ def main(vArgv): if gbDbgFlag: print_out_input_parameters(dictArgs) - # Check to see if we were called from the Makefile system. If we were, check - # if the caller wants SWIG to generate a dependency file. - # Not used in this program, but passed through to the language script file - # called by this program - global gbMakeFileFlag - gbMakeFileFlag = "-m" in dictArgs - nResult, strMsg = run_post_process_for_each_script_supported(dictArgs) program_exit(nResult, strMsg) |