diff options
author | Christian Segundo | 2022-12-05 17:00:08 +0100 |
---|---|---|
committer | Christian Segundo | 2022-12-05 22:16:11 +0100 |
commit | 061a5bae272f45db6dcde99746922735f9769d25 (patch) | |
tree | e4dd9b6d903930c5c1b76286b4a08beea6f59162 /build.zig | |
parent | 8817203517907ef4248bde7474e6fb566515d6a7 (diff) | |
download | advent-of-zig-2022-061a5bae272f45db6dcde99746922735f9769d25.tar.gz |
add day 5
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..ab47001 --- /dev/null +++ b/build.zig @@ -0,0 +1,30 @@ +const std = @import("std"); + +pub fn build(b: *std.build.Builder) void { + // Standard target options allows the person running `zig build` to choose + // what target to build for. Here we do not override the defaults, which + // means any target is allowed, and the default is native. Other options + // for restricting supported target set are available. + const target = b.standardTargetOptions(.{}); + + const exe = b.addExecutable("aoc-2022", "main.zig"); + exe.setTarget(target); + exe.setBuildMode(std.builtin.Mode.ReleaseFast); + exe.install(); + + const run_cmd = exe.run(); + run_cmd.step.dependOn(b.getInstallStep()); + if (b.args) |args| { + run_cmd.addArgs(args); + } + + const run_step = b.step("run", "Run the app"); + run_step.dependOn(&run_cmd.step); + + const exe_tests = b.addTest("main.zig"); + exe_tests.setTarget(target); + exe_tests.setBuildMode(std.builtin.Mode.Debug); + + const test_step = b.step("test", "Run unit tests"); + test_step.dependOn(&exe_tests.step); +} |