#[cfg(target_os = "freebsd")]
fn main() {
use std::env;
use std::path::PathBuf;
println!("cargo:rerun-if-env-changed=LLVM_CONFIG_PATH");
println!("cargo:rustc-link-lib=geom");
let bindings = bindgen::Builder::default()
.header("/usr/include/libgeom.h")
.header("/usr/include/sys/devicestat.h")
.allowlist_function("geom_.*")
.allowlist_function("gctl_.*")
.allowlist_function("g_.*")
.allowlist_type("devstat_trans_flags")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}
#[cfg(not(target_os = "freebsd"))]
fn main() {
println!("cargo:rustc-cfg=crossdocs");
}