master
 1const std = @import("std");
 2const builtin = @import("builtin");
 3
 4pub fn build(b: *std.Build) void {
 5    const test_step = b.step("test", "Test it");
 6    b.default_step = test_step;
 7
 8    const optimize: std.builtin.OptimizeMode = .Debug;
 9    const target = b.graph.host;
10
11    if (builtin.os.tag != .windows) return;
12
13    const relative = b.addExecutable(.{
14        .name = "relative",
15        .root_module = b.createModule(.{
16            .root_source_file = b.path("relative.zig"),
17            .optimize = optimize,
18            .target = target,
19        }),
20    });
21
22    const main = b.addExecutable(.{
23        .name = "test",
24        .root_module = b.createModule(.{
25            .root_source_file = b.path("test.zig"),
26            .optimize = optimize,
27            .target = target,
28        }),
29    });
30
31    const run = b.addRunArtifact(main);
32    run.addArtifactArg(relative);
33    run.expectExitCode(0);
34    run.skip_foreign_checks = true;
35
36    test_step.dependOn(&run.step);
37}