1 Commits

Author SHA1 Message Date
043b6e93c8 fix: compile only on linux 2026-10-03 21:24:05 +02:00
2 changed files with 5 additions and 5 deletions

View File

@@ -2,9 +2,7 @@ use std::env;
use std::path::PathBuf;
fn main() {
let library = pkg_config::Config::new()
.probe("libnotify")
.expect("Cannot locate libnotify. Is it installed?");
let library = pkg_config::Config::new().probe("libnotify").unwrap();
let paths = library
.include_paths
@@ -19,8 +17,7 @@ fn main() {
.generate()
.expect("Unable to generate bindings");
let out_path =
PathBuf::from(env::var("OUT_DIR").expect("Out $OUT_DIR not set. Perhaps a bindgen error?"));
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))

View File

@@ -17,6 +17,9 @@
#![allow(non_snake_case)]
#![warn(missing_docs)]
#[cfg(not(target_os = "linux"))]
compile_error!("Libnotify-rs only supports linux");
/// Basic libnotify rust wrapper
pub mod api;
/// Higher level abstraction over api