This commit is contained in:
2026-09-28 22:20:27 +02:00
commit 3201e8e83a
9 changed files with 433 additions and 0 deletions

25
build.rs Normal file
View File

@@ -0,0 +1,25 @@
use std::env;
use std::path::PathBuf;
fn main() {
let library = pkg_config::Config::new().probe("libnotify").unwrap();
let paths = library
.include_paths
.iter()
.map(|path| format!("-I{}", path.to_str().unwrap()))
.collect::<Vec<_>>();
let bindings = bindgen::Builder::default()
.header("wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.clang_args(paths)
.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"))
.expect("Couldn't write to bindings");
}