use std::env;
use std::path::Path;
fn main() {
let out_dir = env::var("OUT_DIR").expect("OUT_DIR not set");
println!("cargo:rerun-if-changed=build.rs");
let bindings_code = format!(
r#####"
wit_bindgen::generate!({{
world: "vtx-plugin",
inline: r####"
{content}
"####,
pub_export_macro: true,
default_bindings_module: "vtx_sdk::bindings",
}});
"#####,
content = vtx_protocol::WIT_CONTENT
);
let dest_path = Path::new(&out_dir).join("bindings.rs");
std::fs::write(&dest_path, bindings_code).expect("Failed to write bindings.rs");
}