From b9cf69dcd123933cc7edbd3c959ec861764f7dcb Mon Sep 17 00:00:00 2001 From: Abhi Upadhyay Date: Tue, 24 Mar 2026 23:40:17 -0400 Subject: [PATCH] fix: link CoreGraphics framework for Metal device detection MTLCreateSystemDefaultDevice() returns None when CoreGraphics is not linked, causing a panic (swap_remove on empty vec) during Metal device initialization. This affects fresh clones on macOS where nothing else pulls in CoreGraphics. --- cake-core/build.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cake-core/build.rs b/cake-core/build.rs index 040080ce..94893433 100644 --- a/cake-core/build.rs +++ b/cake-core/build.rs @@ -1,4 +1,8 @@ fn main() { + #[cfg(feature = "metal")] + { + println!("cargo:rustc-link-lib=framework=CoreGraphics"); + } #[cfg(feature = "vulkan")] { println!("cargo::rerun-if-changed=src/backends/vulkan/ops.wgsl");