melawy-welcome/build.rs

25 lines
722 B
Rust
Raw Normal View History

use std::process::{self, Command};
use std::{env, fs};
fn main() {
for i in fs::read_dir("data").unwrap() {
println!("cargo:rerun-if-changed={}", i.unwrap().path().display());
}
for i in fs::read_dir("ui").unwrap() {
println!("cargo:rerun-if-changed={}", i.unwrap().path().display());
}
let out_dir = env::var("OUT_DIR").unwrap();
let status = Command::new("glib-compile-resources")
2023-10-13 01:33:20 +05:00
.arg(&format!("--target={}/melawy-welcome.gresource", out_dir))
.arg("melawy-welcome.gresource.xml")
.status()
.unwrap();
if !status.success() {
eprintln!("glib-compile-resources failed with exit status {}", status);
process::exit(1);
}
}