Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to specify which repositories to generate SConscript files for #1192

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tools/build_script_generator/scons/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ from os.path import join, relpath, isdir, exists
def init(module):
module.name = ":build:scons"
module.description = FileReader("module.md")
module.order = 10000 # do project-wide file generation last


def prepare(module, options):
Expand Down Expand Up @@ -207,7 +208,12 @@ def post_build(env):
if nflag: return nflag;
return '"{}"'.format(flag)

for repo in repositories:
# Generate SConscript files for each repository that doesn't already have one
repos_with_sconscript = set(op.repository for op in env.buildlog.operations
if op.filename == f"{op.repository}/SConscript")
repos_without_sconscript = set(repositories) - repos_with_sconscript

for repo in repos_without_sconscript:
files = []
repo_filter = lambda scope: scope.repository == repo
repo_flags = env.query("::collect_flags")(env, repo_filter)
Expand Down Expand Up @@ -237,7 +243,6 @@ def post_build(env):
"is_modm": repo == "modm",
})

# Generate library SConscript
env.outbasepath = repo
env.template("resources/SConscript.in", "SConscript",
filters={"flags_format": flags_format,
Expand Down
Loading