| ... | ... | @@ -3,7 +3,7 @@ const deps = @import("./deps.zig"); |
| 3 | 3 | |
| 4 | 4 | pub fn build(b: *std.Build) void { |
| 5 | 5 | const target = b.standardTargetOptions(.{}); |
| 6 | | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| 6 | const mode = b.option(std.builtin.OptimizeMode, "mode", "") orelse .Debug; |
| 7 | 7 | const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false; |
| 8 | 8 | |
| 9 | 9 | const step = b.option([]const u8, "step", "") orelse "run"; |
| ... | ... | @@ -16,9 +16,11 @@ pub fn build(b: *std.Build) void { |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | const tests = b.addTest(.{ |
| 19 | | .root_source_file = b.path("test.zig"), |
| 20 | | .target = target, |
| 21 | | .optimize = mode, |
| 19 | .root_module = b.createModule(.{ |
| 20 | .root_source_file = b.path("test.zig"), |
| 21 | .target = target, |
| 22 | .optimize = mode, |
| 23 | }), |
| 22 | 24 | }); |
| 23 | 25 | deps.addAllTo(tests); |
| 24 | 26 | tests.use_llvm = !disable_llvm; |
| ... | ... | @@ -31,12 +33,14 @@ pub fn build(b: *std.Build) void { |
| 31 | 33 | test_step.dependOn(&tests_run.step); |
| 32 | 34 | } |
| 33 | 35 | |
| 34 | | fn addExeStep(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.Mode, name: []const u8, root_src: []const u8, sdescription: []const u8) void { |
| 36 | fn addExeStep(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.OptimizeMode, name: []const u8, root_src: []const u8, sdescription: []const u8) void { |
| 35 | 37 | const exe = b.addExecutable(.{ |
| 36 | 38 | .name = name, |
| 37 | | .root_source_file = b.path(root_src), |
| 38 | | .target = target, |
| 39 | | .optimize = mode, |
| 39 | .root_module = b.createModule(.{ |
| 40 | .root_source_file = b.path(root_src), |
| 41 | .target = target, |
| 42 | .optimize = mode, |
| 43 | }), |
| 40 | 44 | }); |
| 41 | 45 | deps.addAllTo(exe); |
| 42 | 46 | b.installArtifact(exe); |