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