From ba1d43354da18aa473200fefde8316e8017841a7 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 24 Mar 2024 15:04:11 +0000 Subject: Handle options in GC config for custom runtimes --- src/main/java/org/shedlang/compiler/runtime/ShedRuntime.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main/java/org/shedlang/compiler/runtime') diff --git a/src/main/java/org/shedlang/compiler/runtime/ShedRuntime.java b/src/main/java/org/shedlang/compiler/runtime/ShedRuntime.java index 25a81345..7c9dbddd 100644 --- a/src/main/java/org/shedlang/compiler/runtime/ShedRuntime.java +++ b/src/main/java/org/shedlang/compiler/runtime/ShedRuntime.java @@ -7,6 +7,7 @@ import org.shedlang.compiler.filesystem.ShedCompilerFiles; import org.shedlang.compiler.util.processes.ProcessError; import java.nio.file.Path; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; @@ -46,16 +47,20 @@ public class ShedRuntime { } // TODO: deal with stale compiled runtimes (in build.py?) - // TODO: handle GC config var runtimeDir = targetDir.topLevel("runtime"); - var buildRuntimeCommand = List.of( + var buildRuntimeCommand = new ArrayList<>(List.of( "python3", ShedCompilerFiles.getRoot().resolve("runtime/build.py").toString(), "custom", "--target", targetName, "--gc", gc.name(), "--output-dir", runtimeDir.toString() - ); + )); + + for (var option : gc.runtimeBuildOptions()) { + buildRuntimeCommand.add("-D" + option); + } + runInheritIo(buildRuntimeCommand); return new ShedRuntime(runtimeDir); -- cgit v1.2.3