mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-22 22:13:11 -05:00
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
This commit is contained in:
parent
1cf910fb51
commit
67f369484c
1 changed files with 3 additions and 0 deletions
|
@ -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…
Reference in a new issue