Closed
Description
I see references to people getting wgpu to build for iOS, but I am failing to figure out how.
I am trying to build a static library for wgpu, then building a project in Xcode that uses C and Swift, and linking it against the static library. I have this working for macOS.
What I have tried so far:
- "cargo lipo" - fails because of a bug in cargo-lipo: Final step fails when package name contains a dash TimNN/cargo-lipo#32
- Applied this PR to cargo-lipo to fix the bug: Replace - by _ in library names TimNN/cargo-lipo#30 - Now libwgpu_native.a does build (with a warning about cdylib not being supported but this does not seem to matter, since I don't want a dylib).
- Building for simulator on Xcode 10 does not work due to Metal not being supported, this is expected.
- Building for simulator on Xcode 11 does not work and gives hundreds of warnings like "ld: warning: building for iOS Simulator, but linking in object file (/.../libwgpu_native.a(wgpu_native.23kem15cwy8kmrf8.rcgu.o)) built for", and then fails to link the wgpu symbols.
- Building for device on Xcode 10 or 11 gives this error: "ignoring file libwgpu_native.a, file was built for archive which is not the architecture being linked (arm64)", and then every wgpu symbol is not found.
- I tried taking the .a files apart and re-building them with ar, but that changes nothing.
- I also tried taking just the arm64 .a file before lipo combines it into a fat library along with x86_64, but that also fixes nothing.
Any hints what I should be trying?
Activity