Skip to content

build.rs: link MetalKit for tvOS targets - #712

Open
nivaldomcj wants to merge 1 commit into
not-fl3:masterfrom
nivaldomcj:tvos-link-metalkit
Open

nivaldomcj wants to merge 1 commit into
not-fl3:masterfrom
nivaldomcj:tvos-link-metalkit

Conversation

@nivaldomcj

Copy link
Copy Markdown

build.rs links MetalKit only when the target name contains darwin or ios, so the tvOS targets (aarch64-apple-tvos, aarch64-apple-tvos-sim) never get it. The tvOS backend reuses the iOS one, and its create_metal_view calls class!(MTKView), so a tvOS app panics at launch at src/native/ios.rs:507.

I found this while testing #711 on the tvOS simulator. Linking at all also needs the objc-rs change from #652/#653, which I applied locally to both builds below.

On the tvOS 26.5 simulator (Xcode 27.2), examples/quad panics at ios.rs:507 on master. On this branch the binary links MetalKit and the example draws.

cargo build --all-targets passes for aarch64-apple-darwin and x86_64-apple-darwin, and cargo check --all-targets for the iOS and tvOS targets.

Tested on macOS 27.2.1 (26B131), Apple M3 Max (arm64), Rust 1.98.0.

The MetalKit link was gated on the target name containing "darwin" or
"ios", so tvOS targets never linked it, and the iOS backend's
class!(MTKView) panicked at launch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant