Skip to content

Commit 515e90e

Browse files
committed
Skip run/test steps on Windows
1 parent 546387b commit 515e90e

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

build.zig

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,24 @@ pub fn build(b: *std.Build) void {
4545

4646
b.installArtifact(exe);
4747

48-
// Run step
49-
const run_step = b.step("run", "Run the app");
50-
const run_cmd = b.addRunArtifact(exe);
51-
run_step.dependOn(&run_cmd.step);
52-
run_cmd.step.dependOn(b.getInstallStep());
48+
const is_windows = target.result.os.tag == .windows;
49+
if (!is_windows) {
50+
// Run step (disabled on Windows due to Zig run-step path assertions)
51+
const run_step = b.step("run", "Run the app");
52+
const run_cmd = b.addRunArtifact(exe);
53+
run_step.dependOn(&run_cmd.step);
54+
run_cmd.step.dependOn(b.getInstallStep());
5355

54-
if (b.args) |args| {
55-
run_cmd.addArgs(args);
56-
}
56+
if (b.args) |args| {
57+
run_cmd.addArgs(args);
58+
}
5759

58-
// Test step
59-
const exe_tests = b.addTest(.{
60-
.root_module = exe.root_module,
61-
});
62-
const run_exe_tests = b.addRunArtifact(exe_tests);
63-
const test_step = b.step("test", "Run tests");
64-
test_step.dependOn(&run_exe_tests.step);
60+
// Test step
61+
const exe_tests = b.addTest(.{
62+
.root_module = exe.root_module,
63+
});
64+
const run_exe_tests = b.addRunArtifact(exe_tests);
65+
const test_step = b.step("test", "Run tests");
66+
test_step.dependOn(&run_exe_tests.step);
67+
}
6568
}

0 commit comments

Comments
 (0)