Opens Cargo.toml file to change the create-type
:
[lib]
crate-type = [
'lib',
'staticlib'
]
Go to UNIFFI folder here and run:
cargo build --release --target aarch64-apple-ios
cargo build --release --target x86_64-apple-ios
lipo -create target/aarch64-apple-ios/release/libdidcomm_uniffi.a target/x86_64-apple-ios/release/libdidcomm_uniffi.a -output target/libDidcommiOS.a
We created a libDidcommiOS.a that runs both for iOS Simulator (arm64) and iOS Device (aarch64).
See the available architectures:
rustup target list
Verify the architecture:
lipo -info target/libDidcommiOS.a
lipo -info target/libDidcommiOS.a
Output: Architectures in the fat file: target/libDidcommiOS.a are: x86_64 arm64
Dealing with Rust to build PactSwiftMockServer Cross-compiling for Xcode