rkvm/input/build.rs
2020-09-16 18:04:18 +02:00

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();
}