From 06752299be5eabf191d65d1fda29bc439fea2b1e Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Tue, 19 Nov 2024 22:01:08 +0100 Subject: [PATCH] build: check step --- build.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.zig b/build.zig index 8ec5671..629fd6e 100644 --- a/build.zig +++ b/build.zig @@ -50,6 +50,17 @@ pub fn build(b: *std.Build) void { // step when running `zig build`). b.installArtifact(exe); + const exe_check = b.addExecutable(.{ + .name = "check", + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }); + exe_check.root_module.addImport("zlog", zlog_module); + + const check = b.step("check", "Check if project compiles"); + check.dependOn(&exe_check.step); + // This *creates* a Run step in the build graph, to be executed when another // step is evaluated that depends on it. The next line below will establish // such a dependency.