diff options
author | Ismail Pazarbasi <ismail.pazarbasi@gmail.com> | 2014-11-18 21:46:06 +0000 |
---|---|---|
committer | Ismail Pazarbasi <ismail.pazarbasi@gmail.com> | 2014-11-18 21:46:06 +0000 |
commit | cc7d7f5e0153ccbffcfdefe55871655541033786 (patch) | |
tree | dc1ef52b177e7c61ee86cfdf238746f9b1dcb2b7 /lldb/scripts/buildSwigWrapperClasses.py | |
parent | b32eaddf11a65d52b41935207d69d6ba1564228d (diff) | |
download | bcm5719-llvm-cc7d7f5e0153ccbffcfdefe55871655541033786.tar.gz bcm5719-llvm-cc7d7f5e0153ccbffcfdefe55871655541033786.zip |
Find SWIG with CMake
SWIG is searched under certain paths within python script. CMake can
detect SWIG with find_package(SWIG). This is used iff user checks
LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION. If
buildSwigWrapperClasses.py does not receive swigExecutable argument,
then the script will use its current search implementation.
llvm-svn: 222262
Diffstat (limited to 'lldb/scripts/buildSwigWrapperClasses.py')
-rw-r--r-- | lldb/scripts/buildSwigWrapperClasses.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/lldb/scripts/buildSwigWrapperClasses.py b/lldb/scripts/buildSwigWrapperClasses.py index e4165580f8d..d0668ccdea0 100644 --- a/lldb/scripts/buildSwigWrapperClasses.py +++ b/lldb/scripts/buildSwigWrapperClasses.py @@ -85,10 +85,11 @@ Args: -h (optional) Print help information on this program.\n\ automatically. Python install directory.\n\ --argsFile= The args are read from a file instead of the\n\ command line. Other command line args are ignored.\n\ + --swigExecutable= (optional) Full path of swig executable.\n\ \n\ Usage:\n\ buildSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath\n\ - --cfgBldDir=ADirPath --prefix=ADirPath -m -d\n\ + --cfgBldDir=ADirPath --prefix=ADirPath --swigExecutable=ADirPath -m -d\n\ \n\ "; #TAG_PROGRAM_HELP_INFO strHelpInfoExtraWindows = "\ @@ -425,17 +426,19 @@ def check_lldb_swig_executable_file_exists( vDictArgs, veOSType ): dbg = utilsDebug.CDebugFnVerbose( "check_lldb_swig_executable_file_exists()" ); bExeFileFound = False; strStatusMsg = ""; - from utilsOsType import EnumOsType; - - switch = { EnumOsType.Unknown : check_lldb_swig_executable_file_exists_Unknown, + if "--swigExecutable" in vDictArgs: + vDictArgs["--swigExeName"] = os.path.basename(vDictArgs["--swigExecutable"]) + vDictArgs["--swigExePath"] = os.path.dirname(vDictArgs["--swigExecutable"]) + bExeFileFound = True + else: + from utilsOsType import EnumOsType; + switch = { EnumOsType.Unknown : check_lldb_swig_executable_file_exists_Unknown, EnumOsType.Darwin : check_lldb_swig_executable_file_exists_Darwin, EnumOsType.FreeBSD : check_lldb_swig_executable_file_exists_FreeBSD, EnumOsType.Linux : check_lldb_swig_executable_file_exists_Linux, - EnumOsType.Windows : check_lldb_swig_executable_file_exists_Windows } - bExeFileFound, strStatusMsg = switch[ veOSType ]( vDictArgs ); - + EnumOsType.Windows : check_lldb_swig_executable_file_exists_Windows } + bExeFileFound, strStatusMsg = switch[ veOSType ]( vDictArgs ); return (bExeFileFound, strStatusMsg); - #++--------------------------------------------------------------------------- # Details: Validate the arguments passed to the program. This function exits # the program should error with the arguments be found. @@ -450,14 +453,15 @@ def validate_arguments( vArgv ): dictArgs = {}; nResult = 0; strListArgs = "hdmM"; # Format "hiox:" = -h -i -o -x <arg> - listLongArgs = ["srcRoot=", "targetDir=", "cfgBldDir=", "prefix=", - "argsFile"]; + listLongArgs = ["srcRoot=", "targetDir=", "cfgBldDir=", "prefix=", + "swigExecutable=", "argsFile"]; dictArgReq = { "-h": "o", # o = optional, m = mandatory "-d": "o", "-m": "o", "-M": "o", "--srcRoot": "m", "--targetDir": "m", + "--swigExecutable" : "o", "--cfgBldDir": "o", "--prefix": "o", "--argsFile": "o" }; @@ -553,8 +557,8 @@ def main( vArgv ): --argsFile= The args are read from a file instead of the command line. Other command line args are ignored. Usage: - buildSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath - --cfgBldDir=ADirPath --prefix=ADirPath -m -d + buildSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath + --cfgBldDir=ADirPath --prefix=ADirPath --swigExecutable=ADirPath -m -d Results: 0 Success -1 Error - invalid parameters passed. @@ -579,4 +583,3 @@ if __name__ == "__main__": main( sys.argv[ 1: ] ); else: program_exit( -5, strMsgErrorNoMain ); -
\ No newline at end of file |