my solutions to advent of code
aoc advent-of-code
1const std = @import("std"); 2 3pub fn build(b: *std.Build) void { 4 const target = b.standardTargetOptions(.{}); 5 6 const optimize = b.standardOptimizeOption(.{}); 7 8 const exe = b.addExecutable(.{ 9 .name = "zig", 10 .root_module = b.createModule(.{ 11 .root_source_file = b.path("src/main.zig"), 12 13 .target = target, 14 .optimize = optimize, 15 }), 16 }); 17 18 b.installArtifact(exe); 19 20 const run_step = b.step("run", "Run the app"); 21 22 const run_cmd = b.addRunArtifact(exe); 23 run_step.dependOn(&run_cmd.step); 24 25 run_cmd.step.dependOn(b.getInstallStep()); 26 27 if (b.args) |args| { 28 run_cmd.addArgs(args); 29 } 30 31 const exe_tests = b.addTest(.{ 32 .root_module = exe.root_module, 33 }); 34 35 const run_exe_tests = b.addRunArtifact(exe_tests); 36 37 const test_step = b.step("test", "Run tests"); 38 test_step.dependOn(&run_exe_tests.step); 39}