audrey/build.rs

24 lines
963 B
Rust
Raw Normal View History

2024-10-29 10:46:58 +00:00
fn main() {
let meson_build_root =
std::env::var("MESON_BUILD_ROOT").expect("build this through meson please!!");
2024-10-29 10:46:58 +00:00
glib_build_tools::compile_resources(
&["resources", &format!("{meson_build_root}/resources")],
2024-10-29 10:46:58 +00:00
"resources/audrey.gresource.xml",
"audrey.gresource",
);
2024-11-05 08:39:27 +00:00
println!("cargo::rerun-if-changed=resources/audrey.gresource.xml");
2024-10-30 08:00:49 +00:00
// TODO: consider using meson to pass include paths
println!("cargo:rustc-link-lib=mpv");
2024-10-30 08:00:49 +00:00
let bindings = bindgen::Builder::default()
.header("src/mpv/wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.generate()
.expect("could not generate bindings for mpv");
let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
2024-10-30 08:00:49 +00:00
bindings
.write_to_file(out_path.join("mpv_ffi.rs"))
.expect("could not write mpv bindings");
2024-11-05 08:39:27 +00:00
println!("cargo::rerun-if-changed=src/mpv/wrapper.h");
2024-10-29 10:46:58 +00:00
}