From 72675c62265f141e8aef8b925b753aa31a354645 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sun, 9 Jul 2023 01:03:54 -0400 Subject: 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 --- scripts/build/glob_recursive.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 scripts/build/glob_recursive.py (limited to 'scripts/build/glob_recursive.py') 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 -- cgit v1.2.3-56-ga3b1