glfw: fix linking difference between sysroot and non-sysroot (#63)
This effectively gives us the dependencies we need in any case, and works around ziglang/zig#10103 Importantly, this removes a blocker for landing WebGPU support in hexops/mach#62 Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
9bc9984930
commit
9f906cfd94
1 changed files with 12 additions and 12 deletions
|
|
@ -208,7 +208,6 @@ fn linkGLFWDependencies(b: *Builder, step: *std.build.LibExeObjStep, options: Op
|
|||
}
|
||||
},
|
||||
.macos => {
|
||||
step.linkFramework("Cocoa");
|
||||
step.linkFramework("IOKit");
|
||||
step.linkFramework("CoreFoundation");
|
||||
if (options.metal) {
|
||||
|
|
@ -217,18 +216,18 @@ fn linkGLFWDependencies(b: *Builder, step: *std.build.LibExeObjStep, options: Op
|
|||
if (options.opengl) {
|
||||
step.linkFramework("OpenGL");
|
||||
}
|
||||
|
||||
// These are dependencies of the above frameworks, but are not properly picked by zld
|
||||
// when cross-compiling Windows/Linux -> MacOS, or on MacOS (no XCode) with `zig build test -Dtarget=aarch64-macos`
|
||||
// unless linked explicitly here.
|
||||
//
|
||||
// If b.sysroot is set, however, these must NOT be specified. This is a bug in zld.
|
||||
if (b.sysroot == null) {
|
||||
step.linkFramework("CoreGraphics");
|
||||
step.linkFramework("CoreServices");
|
||||
step.linkFramework("AppKit");
|
||||
step.linkFramework("Foundation");
|
||||
step.linkSystemLibrary("objc");
|
||||
step.linkFramework("AppKit");
|
||||
|
||||
// TODO(system_sdk): update MacOS system SDK so we can remove this, see:
|
||||
// https://github.com/hexops/mach/pull/63#issuecomment-962141088
|
||||
switch (@import("builtin").target.os.tag) {
|
||||
.macos => {},
|
||||
else => {
|
||||
step.linkFramework("CoreServices");
|
||||
step.linkFramework("CoreGraphics");
|
||||
step.linkFramework("Foundation");
|
||||
},
|
||||
}
|
||||
},
|
||||
else => {
|
||||
|
|
@ -253,3 +252,4 @@ fn linkGLFWDependencies(b: *Builder, step: *std.build.LibExeObjStep, options: Op
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue