if isinstance(subdir, SCons.Node.FS.Dir):
yield subdir
-def include_child_SConscripts(env, SConscript):
+def include_child_SConscripts(env, SConscript, first=[]):
"""Get all the nested SConscripts in that may alter and pass back
the environment. They may also add thesis subdependencies to that
environment.
"""
- for subdir in subdirs(env, '*'):
+ sdirs = list(subdirs(env, '*'))
+ for subdir in reversed(first): # move first subdirs to the front
+ if subdir in sdirs:
+ sdirs.remove(subdir)
+ sdirs.insert(0, subdir)
+ for subdir in sdirs:
var_sconscript_path = os.path.join(subdir.abspath,
'SConscript')
src_sconscript_path = os.path.join(subdir.srcnode().abspath,
def _recursive_glob_dir(env, *args, **kwargs):
assert len(args) > 0
glob_results = env.fs.Glob(env.subst(args[0]), *args[1:], **kwargs)
- sds = list(subdirs(env, ['*']+args[1:], **kwargs))
+ sds = list(subdirs(env, *(['*']+list(args[1:])), **kwargs))
return (sds, glob_results)
def recursive_glob(env, *args, **kwargs):