A proof of concept for using Rust to create an iOS static library.
Requires Xcode 5 and the iOS 7 SDK.
Based on doublec/rust-from-c-example
What works:
- Rust code exposes simple functions for working with integers and floats, using values, pointers and structs.
- Make file creates architecture-specific libraries for the simulator (
i386
) and devices (armv7
andarmv7s
). - Creates universal static library for linking in iOS binary.
- iOS project builds and runs on simulator and devices.
What doesn't work:
- Compiles without standard library (maybe try with rust-core?)
- When running on Simulator: Functions that return structs with float members cause a crash (maybe related to issue #5744?)
git clone https://github.com/shilgapira/ObjCrust.git
cd ObjCrust/Rust
make
cd ../iOS
open ObjCrust.xcodeproj
- Build and run in Xcode