cargo lipo
Provides a cargo lipo
subcommand which automatically creates a universal library for use with your iOS application.
From anywhere you would usually run cargo
you can now run cargo lipo
or cargo lipo --release
to create a universal library for ios, which can be found in $target/universal/{release|debug}/$lib_name.a
.
Make sure you have a library target in your Cargo.toml
with a crate type of staticlib
:
toml
[lib]
name = "..."
crate-type = ["staticlib"]
Install cargo lipo
with cargo install cargo-lipo
. cargo lipo
can be build with rust 1.8 and later.
You also need a rust compiler which can compile for the iOS targets. If you use rustup all you should have to do is
sh
rustup target add aarch64-apple-ios
rustup target add armv7-apple-ios
rustup target add i386-apple-ios
rustup target add x86_64-apple-ios
Note: This should work on stable starting with the 1.8 release.
Alternatively you can build a rust compiler with iOS support yourself.
Cargo fails with error: can't find crate for `std`
: Your rust compiler most likely does not support cross-compiling to iOS.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.