zig-objc/build.zig

23 lines
678 B
Zig
Raw Normal View History

2023-01-02 14:48:21 -08:00
const std = @import("std");
2023-02-14 18:03:43 -08:00
pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
2023-01-02 14:48:21 -08:00
const target = b.standardTargetOptions(.{});
2023-08-03 16:53:26 -07:00
_ = b.addModule("objc", .{ .source_file = .{ .path = "src/main.zig" } });
2023-02-14 18:03:43 -08:00
const tests = b.addTest(.{
.name = "objc-test",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
2023-01-02 14:48:21 -08:00
tests.linkSystemLibrary("objc");
@import("macos_sdk").addPaths(tests);
2023-06-30 09:49:12 -07:00
b.installArtifact(tests);
2023-01-02 14:48:21 -08:00
const test_step = b.step("test", "Run tests");
2023-06-30 09:49:12 -07:00
const tests_run = b.addRunArtifact(tests);
2023-01-02 14:48:21 -08:00
test_step.dependOn(&tests_run.step);
}