zig/test/link/macho/weak_framework/build.zig
2022-06-28 09:22:04 +02:00

25 lines
716 B
Zig

const std = @import("std");
const Builder = std.build.Builder;
const LibExeObjectStep = std.build.LibExeObjStep;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const test_step = b.step("test", "Test the program");
test_step.dependOn(b.getInstallStep());
const exe = b.addExecutable("test", null);
exe.addCSourceFile("main.c", &[0][]const u8{});
exe.setBuildMode(mode);
exe.linkLibC();
exe.linkFrameworkWeak("Cocoa");
const check = exe.checkObject(.macho);
check.checkStart("cmd LOAD_WEAK_DYLIB");
check.checkNext("name {*}Cocoa");
test_step.dependOn(&check.step);
const run_cmd = exe.run();
test_step.dependOn(&run_cmd.step);
}