mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
* SCons: do not include backup files in build * fbt: now GlobRecursive by default excludes backup files * fbt: added backup file exclusion to plain libs Signed-off-by: Michal Suchanek <msuchanek@suse.de> Co-authored-by: hedger <hedger@users.noreply.github.com> Co-authored-by: hedger <hedger@nanode.su> Co-authored-by: あく <alleteam@gmail.com>
26 lines
575 B
Python
26 lines
575 B
Python
import SCons
|
|
|
|
|
|
def GlobRecursive(env, pattern, node=".", exclude=None):
|
|
results = []
|
|
if isinstance(node, str):
|
|
node = env.Dir(node)
|
|
for f in node.glob("*", source=True, exclude=exclude):
|
|
if isinstance(f, SCons.Node.FS.Dir):
|
|
results += env.GlobRecursive(pattern, f, exclude)
|
|
results += node.glob(
|
|
pattern,
|
|
source=True,
|
|
exclude=exclude,
|
|
)
|
|
# print(f"Glob for {pattern} from {node}: {results}")
|
|
return results
|
|
|
|
|
|
def generate(env):
|
|
env.AddMethod(GlobRecursive)
|
|
|
|
|
|
def exists(env):
|
|
return True
|