From c24d7d6de64345e77b14a6aadf343c8951a57f24 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 10 Jan 2024 20:26:41 -0800 Subject: [PATCH] pkg/harfbuzz: get zig build test working on macOS --- pkg/harfbuzz/build.zig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/harfbuzz/build.zig b/pkg/harfbuzz/build.zig index 280b66a57..51aeb6f81 100644 --- a/pkg/harfbuzz/build.zig +++ b/pkg/harfbuzz/build.zig @@ -18,8 +18,6 @@ pub fn build(b: *std.Build) !void { const module = b.addModule("harfbuzz", .{ .root_source_file = .{ .path = "main.zig" }, - .target = target, - .optimize = optimize, .imports = &.{ .{ .name = "freetype", .module = freetype.module("freetype") }, .{ .name = "macos", .module = macos.module("macos") }, @@ -62,6 +60,13 @@ pub fn build(b: *std.Build) !void { "-DHAVE_FT_GET_TRANSFORM=1", }); if (coretext_enabled and target.result.isDarwin()) { + // This is definitely super sketchy and not right but without this + // zig build test breaks on macOS. We have to look into what exactly + // is going on here but this getting comitted in the interest of + // unblocking zig build test. + module.resolved_target = target; + defer module.resolved_target = null; + try flags.appendSlice(&.{"-DHAVE_CORETEXT=1"}); try apple_sdk.addPaths(b, &lib.root_module); try apple_sdk.addPaths(b, module);