18 lines
543 B
Rust
18 lines
543 B
Rust
#[cfg(feature = "bindgen")]
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
println!("cargo:rustc-link-lib=cap-ng");
|
|
|
|
#[cfg(feature = "bindgen")]
|
|
let bindings = bindgen::Builder::default()
|
|
.header("bindings/cap_ng.h")
|
|
.default_enum_style(bindgen::EnumVariation::Consts)
|
|
.generate()
|
|
.expect("Unable to generate bindings");
|
|
|
|
#[cfg(feature = "bindgen")]
|
|
bindings
|
|
.write_to_file(PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("cap_ng_sys.rs"))
|
|
.expect("Couldn't write bindings!");
|
|
}
|