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