forked from OSchip/llvm-project
Be *stupider* about what constitutes a supported language binding.
We were trying to be super smart and find all the supported language bindings. This led to us scanning the directory and treating all subdirectories as language binding directories. This makes it hard to add unrelated code in this folder. Besides, we only support one at the moment - Python. And when new ones are added it will be trivial to just add their names to a list. So this patch gets stupider about how to look for language binding subfolders. Just put them in a list, and use the list. llvm-svn: 254078
This commit is contained in:
parent
1270b0a91d
commit
5de07b078d
|
@ -253,24 +253,7 @@ def run_post_process_for_each_script_supported(vDictArgs):
|
|||
return (-8, strScriptDirNotFound)
|
||||
|
||||
# Look for any script language directories to build for
|
||||
listDirs = []
|
||||
nDepth = 1
|
||||
for strPath, listDirs, listFiles in os.walk(strScriptDir):
|
||||
nDepth = nDepth - 1
|
||||
if nDepth == 0:
|
||||
break
|
||||
|
||||
# Skip the directory that contains the interface files.
|
||||
listDirs.remove('interface')
|
||||
# and the svn directory.
|
||||
if '.svn' in listDirs:
|
||||
listDirs.remove('.svn')
|
||||
|
||||
if gbDbgFlag:
|
||||
sys.stdout.write(strScriptLangsFound)
|
||||
for dir in listDirs:
|
||||
sys.stdout.write(dir)
|
||||
print("\n")
|
||||
listDirs = ["Python"]
|
||||
|
||||
# Iterate script directory find any script language directories
|
||||
for scriptLang in listDirs:
|
||||
|
|
|
@ -71,17 +71,7 @@ def prepare_all_bindings(options):
|
|||
logging.error("failed to find scripts dir: '%s'", scripts_dir)
|
||||
sys.exit(-8)
|
||||
|
||||
# Collect list of child directories. We expect there to be one
|
||||
# for each supported script language.
|
||||
child_dirs = [f for f in os.listdir(scripts_dir)
|
||||
if os.path.isdir(os.path.join(scripts_dir, f))]
|
||||
|
||||
# Remove directories that do not represent script languages.
|
||||
for removal_dir in [".svn", "interface", "__pycache__", "sphinx", "swig_bot_lib"]:
|
||||
if removal_dir in child_dirs:
|
||||
child_dirs.remove(removal_dir)
|
||||
|
||||
logging.info("found script directories: %s", child_dirs)
|
||||
child_dirs = ["Python"]
|
||||
|
||||
# Iterate script directory find any script language directories
|
||||
for script_lang in child_dirs:
|
||||
|
|
Loading…
Reference in New Issue