#![cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
use std::{env, path::PathBuf};
use delight_build::setup_lib3delight;
fn main() -> Result<(), Box<dyn std::error::Error>> {
setup_lib3delight()?;
println!("cargo:rerun-if-changed=include/wrapper.h");
let bindings = bindgen::Builder::default()
.header("include/wrapper.h")
.allowlist_type("Dl.*")
.allowlist_function("Dl.*")
.clang_arg("-Iinclude")
.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"))?;
Ok(())
}