diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-07-09 07:03:54 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2023-07-21 20:35:14 +0200 |
commit | 72675c62265f141e8aef8b925b753aa31a354645 (patch) | |
tree | 4664643e55fe80a4065b184f2bb87613f0000a50 /scripts/build/glob_recursive.py | |
parent | 40e412da4a11de97dda041287e306ca285c50ccf (diff) |
Separate build functions from SConstruct
Placed in scripts/build
Streamline scons options with OptionsClass in scripts/build/option_handler.py
Move `show_progress` cache function to scripts/build/cache.py
Move `GlobRecursive` function to scripts/build/glob_recursive.py
Make environment clone of godot-cpp's build
Prevents environment leakage into godot-cpp
Diffstat (limited to 'scripts/build/glob_recursive.py')
-rw-r--r-- | scripts/build/glob_recursive.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/build/glob_recursive.py b/scripts/build/glob_recursive.py new file mode 100644 index 0000000..db6eb80 --- /dev/null +++ b/scripts/build/glob_recursive.py @@ -0,0 +1,15 @@ +def GlobRecursive(pattern, nodes=['.']): + import SCons + import glob + fs = SCons.Node.FS.get_default_fs() + Glob = fs.Glob + + results = [] + for node in nodes: + nnodes = [] + for f in Glob(str(node) + '/*', source=True): + if type(f) is SCons.Node.FS.Dir: + nnodes.append(f) + results += GlobRecursive(pattern, nnodes) + results += Glob(str(node) + '/' + pattern, source=True) + return results |