Installation
Prerequisites
- Rust 1.70+ - Install from rustup.rs
- For iOS: Xcode 15+ with command line tools
- For Android: Android Studio with NDK installed
- For Java: JDK 8+ with
javacand a C compiler for the JNI bridge
Install the CLI
cargo install boltffi_cli
Add to your project
Add BoltFFI dependencies to your Cargo.toml:
[package]
name = "mylib"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["staticlib"]
[dependencies]
boltffi = "0.1"
[build-dependencies]
boltffi = "0.1"
Add cdylib only if you also need a standalone Rust shared library outside BoltFFI packaging.
Create build.rs
Create a build.rs file in your project root:
fn main() {
boltffi::build::generate();
}
Verify installation
boltffi check
This verifies you have the required tools and Rust targets installed. Run boltffi check --fix to auto-install missing targets.