| ... | ... | @@ -2,23 +2,19 @@ const std = @import("std"); |
| 2 | 2 | const deps = @import("./deps.zig"); |
| 3 | 3 | |
| 4 | 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 | 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 |
| 12 | | // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. |
| 13 | | const mode = b.standardReleaseOptions(); |
| 14 | | |
| 15 | | const exe = b.addExecutable("zig-oauth2", "./main.zig"); |
| 16 | | exe.setTarget(target); |
| 17 | | exe.setBuildMode(mode); |
| 8 | const exe = b.addExecutable(.{ |
| 9 | .name = "zig-oauth2", |
| 10 | .root_source_file = .{ .path = "./main.zig" }, |
| 11 | .target = target, |
| 12 | .optimize = mode, |
| 13 | }); |
| 18 | 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 | 18 | run_cmd.step.dependOn(b.getInstallStep()); |
| 23 | 19 | if (b.args) |args| { |
| 24 | 20 | run_cmd.addArgs(args); |