-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
23 lines (19 loc) · 685 Bytes
/
build.rs
File metadata and controls
23 lines (19 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::process::Command;
fn main() {
// Compile GResource
println!("cargo:rerun-if-changed=resources.gresource.xml");
println!("cargo:rerun-if-changed=assets");
let out_dir = std::env::var("OUT_DIR").unwrap();
// Compile the GResource file
let status = Command::new("glib-compile-resources")
.arg("resources.gresource.xml")
.arg("--target")
.arg(format!("{}/resources.gresource", out_dir))
.arg("--sourcedir")
.arg(".")
.status()
.expect("Failed to execute glib-compile-resources. Make sure it is installed.");
if !status.success() {
panic!("glib-compile-resources failed");
}
}