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.
This commit is contained in:
iddev5 2022-05-23 12:22:12 +05:30 committed by Stephen Gutekanst
parent 8d067b62c2
commit 4fad3b93d2

View file

@ -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");