summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon 'Sze' L. Schlee <schlee.simon@gmail.com>2025-08-24 03:08:17 +0200
committerSimon 'Sze' L. Schlee <schlee.simon@gmail.com>2025-08-24 03:08:17 +0200
commit02db8326778072c638b84293b30b55999f5ba585 (patch)
tree284985621b074e03f4b7b0433b0cdf5d4f818f55
parent1407c7fb91d7a587e053de23ea640d5f6b0b2951 (diff)
pass -freference-trace to executed compile command
Currently users executing `zig build` to run the exercises, may encounter compiler output that tells them to use `-freference-trace=[num]` to see more of the hidden reference traces, so we should pass this parameter to the zigling exercise being compiled, so that the learner can provide this parameter like they would normally, when using `zig build` directly in normal Zig programs.
-rw-r--r--build.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index e72dd4d..7e8bf7a 100644
--- a/build.zig
+++ b/build.zig
@@ -508,6 +508,10 @@ const ZiglingStep = struct {
zig_args.append("-lc") catch @panic("OOM");
}
+ if (b.reference_trace) |rt| {
+ zig_args.append(b.fmt("-freference-trace={}", .{rt})) catch @panic("OOM");
+ }
+
zig_args.append(b.pathFromRoot(path)) catch @panic("OOM");
zig_args.append("--cache-dir") catch @panic("OOM");