| 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); |
| 3 | |
| 4 | pub 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.Optimize = .debug; |
| 9 | |
| 10 | if (builtin.os.tag == .windows and b.graph.environ_map.contains("ConEmuHWND")) { |
| 11 | // ConEmu injects environment variables into processes before they are executed |
| 12 | // depending on user settings. This obviously invalidates the test, so skipping |
| 13 | // it is the best option. |
| 14 | return; |
| 15 | } |
| 16 | |
| 17 | if (builtin.os.tag == .windows and builtin.cpu.arch == .aarch64) { |
| 18 | // https://github.com/ziglang/zig/issues/13685 |
| 19 | return; |
| 20 | } |
| 21 | |
| 22 | const main = b.addExecutable(.{ |
| 23 | .name = "main", |
| 24 | .root_module = b.createModule(.{ |
| 25 | .root_source_file = b.path("main.zig"), |
| 26 | .target = b.graph.host, |
| 27 | .optimize = optimize, |
| 28 | }), |
| 29 | }); |
| 30 | |
| 31 | const run = b.addRunArtifact(main); |
| 32 | run.clearEnvironment(); |
| 33 | run.disable_zig_progress = true; |
| 34 | run.color = .manual; |
| 35 | |
| 36 | test_step.dependOn(&run.step); |
| 37 | } |