1bec8dd23a
* Install Rust in docker image * Also install thumbv7em-none-eabi target * Install Rust in docker image * Also install thumbv7em-none-eabi target * Add Rust example * Link to the Rust example * Call function from the Rust lib * Move PROJECT_DIR to the 'paths' section * Fix target_f1 build * Link to the Rust library in target_f1 * Generate cbindgen bindings * Add forgotten dependency line * Use panic=abort instead of eh_personality lang item * Install Rust in docker image * Also install thumbv7em-none-eabi target * Add Rust example * Link to the Rust example * Call function from the Rust lib * Move PROJECT_DIR to the 'paths' section * Link to the Rust library in target_f1 * Generate cbindgen bindings * Add forgotten dependency line * Use panic=abort instead of eh_personality lang item * add rust call test Co-authored-by: aanper <mail@s3f.ru>
13 lines
376 B
Rust
13 lines
376 B
Rust
use std::env;
|
|
use std::path::Path;
|
|
|
|
fn main() {
|
|
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
let pkg_name = env::var("CARGO_PKG_NAME").unwrap();
|
|
|
|
cbindgen::generate(&crate_dir)
|
|
.expect("Unable to generate cbindgen bindings")
|
|
.write_to_file(
|
|
Path::new(&crate_dir).join("bindings").join(format!("{}.h", pkg_name))
|
|
);
|
|
} |