| ... | @@ -2,23 +2,19 @@ const std = @import("std"); | ... | @@ -2,23 +2,19 @@ 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.Builder) void { | 4 | pub fn build(b: *std.build.Builder) void { |
| 5 | // Standard target options allows the person running `zig build` to choose | | |
| 6 | // what target to build for. Here we do not override the defaults, which | | |
| 7 | // means any target is allowed, and the default is native. Other options | | |
| 8 | // for restricting supported target set are available. | | |
| 9 | const target = b.standardTargetOptions(.{}); | 5 | const target = b.standardTargetOptions(.{}); |
| | 6 | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| 10 | | 7 | |
| 11 | // Standard release options allow the person running `zig build` to select | 8 | const exe = b.addExecutable(.{ |
| 12 | // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. | 9 | .name = "zig-oauth2", |
| 13 | const mode = b.standardReleaseOptions(); | 10 | .root_source_file = .{ .path = "./main.zig" }, |
| 14 | | 11 | .target = target, |
| 15 | const exe = b.addExecutable("zig-oauth2", "./main.zig"); | 12 | .optimize = mode, |
| 16 | exe.setTarget(target); | 13 | }); |
| 17 | exe.setBuildMode(mode); | | |
| 18 | deps.addAllTo(exe); | 14 | deps.addAllTo(exe); |
| 19 | exe.install(); | 15 | b.installArtifact(exe); |
| 20 | | 16 | |
| 21 | const run_cmd = exe.run(); | 17 | const run_cmd = b.addRunArtifact(exe); |
| 22 | run_cmd.step.dependOn(b.getInstallStep()); | 18 | run_cmd.step.dependOn(b.getInstallStep()); |
| 23 | if (b.args) |args| { | 19 | if (b.args) |args| { |
| 24 | run_cmd.addArgs(args); | 20 | run_cmd.addArgs(args); |