mirror of
https://github.com/htrefil/rkvm.git
synced 2025-01-30 20:34:13 +01:00
18 lines
451 B
Rust
18 lines
451 B
Rust
use bindgen::{Builder, CargoCallbacks};
|
|
use std::env;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed=wrapper.h");
|
|
|
|
let bindings = Builder::default()
|
|
.header("wrapper.h")
|
|
.parse_callbacks(Box::new(CargoCallbacks))
|
|
.generate()
|
|
.unwrap();
|
|
|
|
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
|
bindings
|
|
.write_to_file(out_path.join("bindings.rs"))
|
|
.unwrap();
|
|
}
|