zig-examples/zig-error-handling/build.zig

27 lines
680 B
Zig
Raw Normal View History

2024-08-30 22:11:05 +00:00
const std = @import("std");
pub fn build(b: *std.Build) void {
const exe = b.addExecutable(.{
.name = "zig-error-handling",
.root_source_file = b.path("src/main.zig"),
.target = b.host,
});
b.installArtifact(exe);
const run_exe = b.addRunArtifact(exe);
const run_step = b.step("run", "Run the application");
run_step.dependOn(&run_exe.step);
const unit_tests = b.addTest(.{
.root_source_file = b.path("src/main.zig"),
.target = b.host,
});
const test_step = b.step("test", "Run unit tests");
const run_unit_tests = b.addRunArtifact(unit_tests);
test_step.dependOn(&run_unit_tests.step);
}