| ... | @@ -2,12 +2,18 @@ const std = @import("std"); | ... | @@ -2,12 +2,18 @@ const std = @import("std"); |
| 2 | const deps = @import("./deps.zig"); | 2 | const deps = @import("./deps.zig"); |
| 3 | | 3 | |
| 4 | pub fn build(b: *std.Build) void { | 4 | pub fn build(b: *std.Build) void { |
| | 5 | const target = b.standardTargetOptions(.{}); |
| | 6 | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| | 7 | |
| 5 | const t = b.addTest(.{ | 8 | const t = b.addTest(.{ |
| 6 | .root_source_file = .{ .path = "main.zig" }, | 9 | .root_source_file = b.path("main.zig"), |
| | 10 | .target = target, |
| | 11 | .optimize = mode, |
| 7 | }); | 12 | }); |
| 8 | deps.addAllTo(t); | 13 | deps.addAllTo(t); |
| 9 | | 14 | |
| 10 | const run_t = b.addRunArtifact(t); | 15 | const run_t = b.addRunArtifact(t); |
| | 16 | run_t.has_side_effects = true; |
| 11 | | 17 | |
| 12 | const t_step = b.step("test", "Run all the tests."); | 18 | const t_step = b.step("test", "Run all the tests."); |
| 13 | t_step.dependOn(&run_t.step); | 19 | t_step.dependOn(&run_t.step); |