Skip to content

Commit

Permalink
Hints
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Feb 29, 2024
1 parent a62aac4 commit 50e071e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,11 @@ def build_env(prefs: dict[str, str], verbose: bool) -> None:
write_script("build_env.cmd", lines, prefs, verbose)


def build_dep(name: str, prefs, verbose: bool, depends_dir: str) -> str:
def build_dep(name: str, prefs: dict[str, str], verbose: bool) -> str:
dep = DEPS[name]
dir = dep["dir"]
file = f"build_dep_{name}.cmd"
depends_dir = prefs["depends_dir"]
license_dir = prefs["license_dir"]
sources_dir = prefs["src_dir"]

Expand Down Expand Up @@ -591,20 +592,15 @@ def build_dep(name: str, prefs, verbose: bool, depends_dir: str) -> str:
return file


def build_dep_all(
disabled: list,
prefs: dict[str, str],
verbose: bool,
depends_dir: str,
) -> None:
def build_dep_all(disabled: list[str], prefs: dict[str, str], verbose: bool) -> None:
lines = [r'call "{build_dir}\build_env.cmd"']
gha_groups = "GITHUB_ACTIONS" in os.environ
for dep_name in DEPS:
print()
if dep_name in disabled:
print(f"Skipping disabled dependency {dep_name}")
continue
script = build_dep(dep_name, prefs, verbose, depends_dir)
script = build_dep(dep_name, prefs, verbose)
if gha_groups:
lines.append(f"@echo ::group::Running {script}")
lines.append(rf'cmd.exe /c "{{build_dir}}\{script}"')
Expand Down Expand Up @@ -729,6 +725,7 @@ def main() -> None:
# Build paths
"bin_dir": bin_dir,
"build_dir": args.build_dir,
"depends_dir": args.depends_dir,
"inc_dir": inc_dir,
"lib_dir": lib_dir,
"license_dir": license_dir,
Expand All @@ -747,7 +744,7 @@ def main() -> None:

write_script(".gitignore", ["*"], prefs, args.verbose)
build_env(prefs, args.verbose)
build_dep_all(disabled, prefs, args.verbose, args.depends_dir)
build_dep_all(disabled, prefs, args.verbose)


if __name__ == "__main__":
Expand Down

0 comments on commit 50e071e

Please sign in to comment.