extern crate cbindgen;
use std::env;
use std::path::Path;
fn main() {
let out_dir = env::var("OUT_DIR").expect("Target output directory");
let mut header_path = Path::new(&out_dir)
.join("../../../")
.canonicalize()
.expect("Path to iceoryx2 base dir for header generation");
header_path.push("iceoryx2-ffi-cbindgen/include/iox2/iceoryx2.h");
let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("Cargo manifest dir");
cbindgen::generate(crate_dir)
.expect("Unable to generate c bindings")
.write_to_file(header_path);
}