audrey/build.rs

22 lines
832 B
Rust
Raw Normal View History

2024-10-29 10:46:58 +00:00
fn main() {
2024-10-30 08:00:49 +00:00
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-10-30 08:00:49 +00:00
// TODO: consider using meson to pass include paths
println!("cargo:rustc-link-lib=mpv");
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());
bindings
.write_to_file(out_path.join("mpv_ffi.rs"))
.expect("could not write mpv bindings");
2024-10-29 10:46:58 +00:00
}