You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[swift_bridge::bridge]mod ffi {// Export opaque Rust types, functions and methods for Swift to use.extern"Rust"{typeRingContext;typeIetfProof;typeInput;typeOutput;typePublic;typeRingProof;typeSecret;typeIetfVrfSignature;fnring_context() -> &'staticRingContext;fnvrf_input_point(vrf_input_data:&[u8]) -> Input;}}
I have this setup for a swift package, I want to access a generated function in swift, and have the following error:
I also tried to include generated folder in sources, but it will give lots of errors like error: cannot find '__swift_bridge__$xxx$xxxx' in scope from generated .swift files
Please check if this scenario can be solved, thanks in advance
Take a look at #307 - you need to generate two targets, one for the C code and one for the Swift code. The Swift one will need to import the C one (in the generated files).
Problem
I have this setup for a swift package, I want to access a generated function in swift, and have the following error:
It's probably sth wrong with my setup, and I didn't follow https://chinedufn.github.io/swift-bridge/building/swift-packages/index.html as my pacakge later will also need to be run on linux, so I followed https://chinedufn.github.io/swift-bridge/building/swiftc-and-cargo/index.html and tried to make it work in spm
I also tried to include
generated
folder insources
, but it will give lots of errors likeerror: cannot find '__swift_bridge__$xxx$xxxx' in scope
from generated .swift filesPlease check if this scenario can be solved, thanks in advance
Steps
cargo build --target aarch64-apple-darwin
The text was updated successfully, but these errors were encountered: