use std::env;
use std::path::PathBuf;
fn main() {
println!("cargo:rustc-link-lib=dlt");
let bindings = bindgen::Builder::default()
.header("src/libdlt_wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.allowlist_item("dlt_register_app")
.allowlist_item("dlt_register_context")
.allowlist_item("dlt_log_string")
.rustified_enum("DltReturnValue")
.rustified_enum("DltLogLevelType")
.must_use_type("DltReturnValue")
.derive_default(true)
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("libdlt_bindings.rs"))
.expect("Couldn't write bindings!");
}