From 4fad3b93d2f7b53b5c9b68165827707a5e5451de Mon Sep 17 00:00:00 2001 From: iddev5 Date: Mon, 23 May 2022 12:22:12 +0530 Subject: [PATCH] mach: add compile-only step for examples and shaderexp These steps will only compile and install the applications but not run it. To be used as ``zig build example-*`` and ``zig build shaderexp`` respectively, i.e without the run prefix. --- build.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.zig b/build.zig index 050d7965..077c6a5b 100644 --- a/build.zig +++ b/build.zig @@ -61,6 +61,9 @@ pub fn build(b: *std.build.Builder) void { example_app.link(options); example_app.install(); + const example_compile_step = b.step("example-" ++ example.name, "Compile the example"); + example_compile_step.dependOn(&example_app.getInstallStep().?.step); + if (target.toTarget().cpu.arch != .wasm32) { const example_run_cmd = example_app.run(); example_run_cmd.step.dependOn(&example_app.getInstallStep().?.step); @@ -83,6 +86,9 @@ pub fn build(b: *std.build.Builder) void { shaderexp_app.link(options); shaderexp_app.install(); + const shaderexp_compile_step = b.step("shaderexp", "Compile shaderexp"); + shaderexp_compile_step.dependOn(&shaderexp_app.getInstallStep().?.step); + const shaderexp_run_cmd = shaderexp_app.run(); shaderexp_run_cmd.step.dependOn(&shaderexp_app.getInstallStep().?.step); const shaderexp_run_step = b.step("run-shaderexp", "Run shaderexp");