diff options
author | Manlio Perillo <manlio.perillo@gmail.com> | 2023-04-08 09:51:07 +0200 |
---|---|---|
committer | Manlio Perillo <manlio.perillo@gmail.com> | 2023-04-11 12:45:27 +0200 |
commit | 67f369484cbba0be0c6dcb9b73cf7f872a25baf7 (patch) | |
tree | dc60a32e83685f9aab3162645f44b0d935c72ab2 | |
parent | 1cf910fb51259e786e8964072eb98a17353bc3c8 (diff) |
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
-rw-r--r-- | build.zig | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -560,6 +560,9 @@ pub fn build(b: *Build) !void { }) catch unreachable; const build_step = b.addExecutable(.{ .name = base_name, .root_source_file = .{ .path = file_path } }); + if (ex.C) { + build_step.linkLibC(); + } build_step.install(); const run_step = build_step.run(); |