zig0

my attempts at zig bootstrapping in C
Log | Files | Refs | README | LICENSE

commit c54786ef508b511c1efe31db1cb48672f30108e3 (tree)
parent f1dc68724d552a86dfc1b43513b90e51e6f8881c
Author: Motiejus Jakštys <motiejus@jakstys.lt>
Date:   Thu, 12 Feb 2026 14:06:15 +0200

quicker `zig build test`

Diffstat:
MREADME.md | 8++++----
Mbuild.zig | 11+++++------
2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -18,12 +18,12 @@ This is written with help from LLM: Quick test: - zig build test + zig build fmt test -Full test with all supported compilers and valgrind (run before commit, -takes a while): +Full test and static analysis with all supported compilers and valgrind (run +before commit, takes a while): - zig build fmt && zig build -Dvalgrind + zig build -Dvalgrind # Debugging tips diff --git a/build.zig b/build.zig @@ -116,19 +116,18 @@ pub fn build(b: *std.Build) !void { lint_step.dependOn(&cppcheck.step); } - const all_step = b.step("all", "Run fmt check, lint, and tests with all compilers"); - all_step.dependOn(lint_step); - const fmt_check = b.addSystemCommand(&.{ "clang-format", "--dry-run", "-Werror" }); for (all_c_files ++ headers) |f| fmt_check.addFileArg(b.path(f)); fmt_check.expectExitCode(0); - all_step.dependOn(&fmt_check.step); + b.default_step.dependOn(&fmt_check.step); for (compilers) |compiler| { - addTestStep(b, all_step, target, optimize, compiler, false, valgrind, test_timeout); + addTestStep(b, b.default_step, target, optimize, compiler, false, valgrind, test_timeout); } - b.default_step = all_step; + const all_step = b.step("all", "Run fmt check, lint, and tests with all compilers"); + all_step.dependOn(b.default_step); + all_step.dependOn(lint_step); } fn addTestStep(