use std::{env, path::Path}; use anyhow::Result; use bindgen::builder; fn main() -> Result<()> { println!("cargo:rerun-if-changed=include/zygisk.hpp"); let out_dir = env::var("OUT_DIR")?; let out_dir = Path::new(&out_dir); let binding_path = out_dir.join("bindings.rs"); let bindings = builder() .header("include/zygisk.hpp") .enable_cxx_namespaces() .allowlist_item("zygisk.*") .allowlist_function("zygisk_companion_entry") .allowlist_function("zygisk_module_entry") .generate()?; bindings.write_to_file(binding_path)?; Ok(()) }