zig/test/standalone/issue_13030/build.zig
2023-03-15 10:48:14 -07:00

24 lines
669 B
Zig

const std = @import("std");
const builtin = @import("builtin");
const CrossTarget = std.zig.CrossTarget;
pub fn build(b: *std.Build) void {
const test_step = b.step("test", "Test it");
b.default_step = test_step;
add(b, test_step, .Debug);
add(b, test_step, .ReleaseFast);
add(b, test_step, .ReleaseSmall);
add(b, test_step, .ReleaseSafe);
}
fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void {
const obj = b.addObject(.{
.name = "main",
.root_source_file = .{ .path = "main.zig" },
.optimize = optimize,
.target = .{},
});
test_step.dependOn(&obj.step);
}