rkvm/input/build.rs
2020-10-28 19:45:49 +01:00

19 lines
552 B
Rust

use bindgen::{Builder, CargoCallbacks};
use std::env;
use std::path::PathBuf;
fn main() {
println!("cargo:rerun-if-changed=glue/glue.h");
println!("cargo:rustc-link-lib=evdev");
// TODO: pkg-config
let bindings = Builder::default()
.header("glue/glue.h")
.clang_arg("-I/usr/include/libevdev-1.0/")
.parse_callbacks(Box::new(CargoCallbacks))
.generate()
.unwrap();
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings.write_to_file(out_path.join("glue.rs")).unwrap();
}