| ... | @@ -3,16 +3,18 @@ const deps = @import("./deps.zig"); | ... | @@ -3,16 +3,18 @@ const deps = @import("./deps.zig"); |
| 3 | | 3 | |
| 4 | pub fn build(b: *std.build.Builder) void { | 4 | pub fn build(b: *std.build.Builder) void { |
| 5 | const target = b.standardTargetOptions(.{}); | 5 | const target = b.standardTargetOptions(.{}); |
| | 6 | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| 6 | | 7 | |
| 7 | const mode = b.standardReleaseOptions(); | 8 | const exe = b.addExecutable(.{ |
| 8 | | 9 | .name = "zig-pek", |
| 9 | const exe = b.addExecutable("zig-pek", "src/main.zig"); | 10 | .root_source_file = .{ .path = "src/main.zig" }, |
| 10 | exe.setTarget(target); | 11 | .target = target, |
| 11 | exe.setBuildMode(mode); | 12 | .optimize = mode, |
| | 13 | }); |
| 12 | deps.addAllTo(exe); | 14 | deps.addAllTo(exe); |
| 13 | exe.install(); | 15 | b.installArtifact(exe); |
| 14 | | 16 | |
| 15 | const run_cmd = exe.run(); | 17 | const run_cmd = b.addRunArtifact(exe); |
| 16 | run_cmd.step.dependOn(b.getInstallStep()); | 18 | run_cmd.step.dependOn(b.getInstallStep()); |
| 17 | if (b.args) |args| { | 19 | if (b.args) |args| { |
| 18 | run_cmd.addArgs(args); | 20 | run_cmd.addArgs(args); |