Collection of scripts to build Rust for iOS and Android platforms.
Hey! This project is OUTDATED. Nowadays you can get pre-built std library using rustup!
- Scripts were tested only on OSX
- Multirust
https://github.com/brson/multirust
- NDK (and modifying
local.properties
if you will be compiling for Android) - XCode if you will be compiling for iOS
git clone https://github.com/Nercury/rust-mobile.git rust-mobile
For Android, have NDK installed and create and edit local.properties file:
cp local.properties.example local.properties
For iOS, it's enough to make sure XCode can build iOS projects. If not building for iOS, it is easy
to comment out relevant lines in build-all.sh
.
When ready, run it all with (from rust-build
dir, although it does not matter much):
mkdir rust-build
cd rust-build
../rust-mobile/build-all.sh
All immediate files and the output will be places in rust-build
dir.
To the resulting binaries should be integrated into multirust, so you can now compile things with (in your project dir):
multirust override ios
cargo build --target x86_64-apple-ios
Or:
multirust override android
cargo build --target arm-linux-androideabi --release
For the exact list of output platforms, look at build-android.sh
and build-ios.sh
scripts.