Closed dceddia closed 1 year ago
Not directly related but how do you manage to get autocompletion using this "calling from Rust" workflow ? Is there a way to signal to vscode or XCode the use of bridging-header.h ?
On the Rust side I have a âmod ffiâ similar to the examples in this library. That was enough to get autocompletion of my own functions in VSCode. I wouldnât expect it could see âbeyondâ those into Swift anyway; itâs not exposing all of Swift, just the few specific wrappers I wrote. For both Rust and Swift I have the language server plugins installed (rust-analyzer and I forget the name of the Swift one, it was just the most popular one).
Hello! Thank you for your work on this, it's been really nice to use so far. I'm building an app with Tauri and trying to get a universal build going on an M1 Mac, and hit an error during linking.
I have some wrapper scripts around this, but it's effectively running
cargo tauri build --target universal-apple-darwin
(I tried this on its own to make sure my scripts weren't getting in the way đ ). It failed with:Narrowing it down a bit, I noticed the aarch64 build works fine (
cargo tauri build --target aarch64-apple-darwin
) but the x86_64 one fails with the same error (cargo tauri build --target x86_64-apple-darwin
). Makes some sense I guess because I'm running on an M1 and it would be building aarch64 by default.My Swift crate's
build.rs
is patterned after this example. I was hoping that Tauri's universal build would automatically calllipo
, and thought I might only need to get thebuild.rs
to respect the currentTARGET
and let Tauri's build handle the rest. So I modified thecompile_swift
function inbuild.rs
:This got the build to work!
I was halfway through writing this issue when I figured it out, and thought I'd just post this in case it helps anyone else.