-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
30 lines (28 loc) · 870 Bytes
/
build.rs
File metadata and controls
30 lines (28 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::{
io::{stderr, stdout, Write},
process::Command,
};
fn main() {
let output = Command::new("sh")
.arg("./shaders/compile.sh")
.output()
.expect("Failed to compile shaders");
// TODO: Panic if shader compile script failed
println!("Status: {}", output.status);
stdout().write_all(&output.stdout).unwrap();
stderr().write_all(&output.stderr).unwrap();
let watch_files = [
"./shaders/compile.sh",
"./shaders/gradient.comp",
"./shaders/rgb_to_rgba.comp",
"./shaders/colored_triangle.vert",
"./shaders/colored_triangle.frag",
"./shaders/colored_triangle_mesh.frag",
"./shaders/tex_image.frag",
"./shaders/mesh.vert",
"./shaders/mesh.frag",
];
for file in watch_files {
println!("cargo::rerun-if-changed={file}");
}
}