build: ensure the exercise links libc, when needed

When running, as an example, `zig build -Dhealed -Dn=93 test`, the build
fails, because the `test` step use the standard CompileStep, instead of
ZiglingStep.

Ensure that exercises using libc are correctly built.

Closes #229
pull/2/head
Manlio Perillo 1 year ago
parent 1cf910fb51
commit 67f369484c

@ -560,6 +560,9 @@ pub fn build(b: *Build) !void {
}) catch unreachable; }) catch unreachable;
const build_step = b.addExecutable(.{ .name = base_name, .root_source_file = .{ .path = file_path } }); const build_step = b.addExecutable(.{ .name = base_name, .root_source_file = .{ .path = file_path } });
if (ex.C) {
build_step.linkLibC();
}
build_step.install(); build_step.install();
const run_step = build_step.run(); const run_step = build_step.run();

Loading…
Cancel
Save