| ... | @@ -1,37 +0,0 @@ |
| 1 | const std = @import("std"); |
| 2 | const deps = @import("./deps.zig"); |
| 3 | |
| 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(.{}); |
| 10 | |
| 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-git", "main.zig"); |
| 16 | exe.setTarget(target); |
| 17 | exe.setBuildMode(mode); |
| 18 | deps.addAllTo(exe); |
| 19 | exe.install(); |
| 20 | |
| 21 | const run_cmd = exe.run(); |
| 22 | run_cmd.step.dependOn(b.getInstallStep()); |
| 23 | if (b.args) |args| { |
| 24 | run_cmd.addArgs(args); |
| 25 | } |
| 26 | |
| 27 | const run_step = b.step("run", "Run the app"); |
| 28 | run_step.dependOn(&run_cmd.step); |
| 29 | |
| 30 | const exe_tests = b.addTest("main.zig"); |
| 31 | exe_tests.setTarget(target); |
| 32 | exe_tests.setBuildMode(mode); |
| 33 | deps.addAllTo(exe_tests); |
| 34 | |
| 35 | const test_step = b.step("test", "Run unit tests"); |
| 36 | test_step.dependOn(&exe_tests.step); |
| 37 | } |