diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-03-24 15:04:11 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-03-24 15:04:11 +0000 |
| commit | ba1d43354da18aa473200fefde8316e8017841a7 (patch) | |
| tree | ba43d81dc60463059faf91bda3471550de3d288a /runtime | |
| parent | 85f9578fb680ab4ee959469133714acd908a7c10 (diff) | |
Handle options in GC config for custom runtimes
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/build.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/runtime/build.py b/runtime/build.py index cdcf5d89..87ba39af 100644 --- a/runtime/build.py +++ b/runtime/build.py @@ -43,21 +43,26 @@ gcs = ["bump", "mark-and-sweep"] def main(): - os.chdir(Path(__file__).parent) - args = _parse_args() args.func(args) def _main_standard(args): for target in targets: + target_dir = Path(__file__).parent / "target" / target.name + for gc in gcs: - output_dir = Path("target") / target.name / gc - _build_runtime(target=target, gc=gc, output_dir=output_dir) + output_dir = target_dir / gc + _build_runtime( + target=target, + gc=gc, + options=[], + output_dir=output_dir, + ) if target.requires_sizeof_jmp_buf: - sizeof_jmp_buf = subprocess.check_output([Path("target") / target.name / gcs[0] / "sizeof_jmp_buf"]) - with open(Path("target") / target.name / "sizeof_jmp_buf.txt", "wb") as fileobj: + sizeof_jmp_buf = subprocess.check_output([target_dir / gcs[0] / "sizeof_jmp_buf"]) + with open(target_dir / "sizeof_jmp_buf.txt", "wb") as fileobj: fileobj.write(sizeof_jmp_buf) @@ -68,17 +73,17 @@ def _main_custom(args): target=target, gc=args.gc, options=args.options, - output_dir=args.output_dir, + output_dir=Path(args.output_dir), ) def _build_runtime(*, target: Target, gc: str, options: list[str], output_dir: Path): - setup_command = ["meson", "setup", output_dir, "--werror", f"-Dgc={gc}"] + [ + setup_command = ["meson", "setup", output_dir.absolute(), "--werror", f"-Dgc={gc}"] + [ f"-D{option}" for option in options ] if target.name != "amd64": setup_command += ["--cross-file", f"{target.name}.meson"] - subprocess.check_call(setup_command) + subprocess.check_call(setup_command, cwd=Path(__file__).parent) subprocess.check_call(["meson", "compile", "--verbose"], cwd=output_dir) |
