doggo/build.zig

31 lines
801 B
Zig
Raw Normal View History

2022-01-21 15:12:40 +01:00
const std = @import("std");
2024-05-04 19:03:50 +02:00
const capy = @import("capy");
2022-01-21 15:12:40 +01:00
2024-05-04 19:03:50 +02:00
pub fn build(b: *std.Build) !void {
2022-01-21 15:12:40 +01:00
const target = b.standardTargetOptions(.{});
2024-05-04 19:03:50 +02:00
const mode = b.standardOptimizeOption(.{});
2022-01-21 15:12:40 +01:00
2024-05-04 19:03:50 +02:00
const exe = b.addExecutable(.{
.name = "doggo",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = mode,
});
2022-01-21 15:12:40 +01:00
2024-05-04 19:03:50 +02:00
b.installArtifact(exe);
2022-03-24 13:25:40 +01:00
2024-05-04 19:03:50 +02:00
const run_cmd = try capy.install(exe, .{ .args = b.args });
2022-01-21 15:12:40 +01:00
const run_step = b.step("run", "Run the app");
2024-05-04 19:03:50 +02:00
run_step.dependOn(run_cmd);
2022-01-21 15:12:40 +01:00
2024-05-04 19:03:50 +02:00
const exe_tests = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = mode,
});
2022-01-21 15:12:40 +01:00
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&exe_tests.step);
}