mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 00:23:22 +00:00
36 lines
975 B
Zig
36 lines
975 B
Zig
const std = @import("std");
|
|
|
|
pub const requires_symlinks = true;
|
|
|
|
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 target: std.zig.CrossTarget = .{ .os_tag = .macos };
|
|
|
|
const exe = b.addExecutable(.{
|
|
.name = "main",
|
|
.optimize = optimize,
|
|
.target = target,
|
|
});
|
|
exe.addCSourceFile("main.c", &.{});
|
|
exe.linkLibC();
|
|
exe.stack_size = 0x100000000;
|
|
|
|
const check_exe = exe.checkObject();
|
|
check_exe.checkStart("cmd MAIN");
|
|
check_exe.checkNext("stacksize 100000000");
|
|
|
|
const run = b.addRunArtifact(exe);
|
|
run.skip_foreign_checks = true;
|
|
run.expectStdOutEqual("");
|
|
test_step.dependOn(&run.step);
|
|
}
|