glfw: workaround framework dependency inclusion bug for now

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-10-29 12:24:40 -07:00 committed by Stephen Gutekanst
parent 3856c1c95e
commit 2b4b06cf7b

View file

@ -217,12 +217,17 @@ fn linkGLFWDependencies(b: *Builder, step: *std.build.LibExeObjStep, options: Op
} }
// These are dependencies of the above frameworks, but are not properly picked by zld // These are dependencies of the above frameworks, but are not properly picked by zld
// when cross-compiling Windows/Linux -> MacOS unless linked explicitly here. // when cross-compiling Windows/Linux -> MacOS, or on MacOS (no XCode) with `zig build test -Dtarget=aarch64-macos`
step.linkFramework("CoreGraphics"); // unless linked explicitly here.
step.linkFramework("CoreServices"); //
step.linkFramework("AppKit"); // If b.sysroot is set, however, these must NOT be specified. This is a bug in zld.
step.linkFramework("Foundation"); if (b.sysroot == null) {
step.linkSystemLibrary("objc"); step.linkFramework("CoreGraphics");
step.linkFramework("CoreServices");
step.linkFramework("AppKit");
step.linkFramework("Foundation");
step.linkSystemLibrary("objc");
}
}, },
else => { else => {
// Assume Linux-like // Assume Linux-like