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.
This commit is contained in:
Simon 'Sze' L. Schlee 2025-08-24 03:08:17 +02:00
parent 1407c7fb91
commit 02db832677

View File

@ -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");