aoc2025 @ 9296278e038ee98c69478902eb8ad2c19cc78086

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