This commit is contained in:
2023-06-17 16:31:40 +01:00
parent 3005f77045
commit 5fc2cd0a5d
4 changed files with 27 additions and 8 deletions
+2
View File
@@ -0,0 +1,2 @@
[target.'cfg(target_os = "windows")']
linker = "link.exe"
+19 -2
View File
@@ -3,16 +3,33 @@ use std::process::Command;
fn main() { fn main() {
println!("cargo:rerun-if-changed=shaders/shader.vert"); println!("cargo:rerun-if-changed=shaders/shader.vert");
println!("cargo:rerun-if-changed=shaders/shader.frag"); println!("cargo:rerun-if-changed=shaders/shader.frag");
let out = Command::new("glslc.exe") let out;
if cfg!(windows) {
out = Command::new("glslc.exe")
.args(&["shaders/shader.vert", "-Os", "-o", "shaders/vert.spv"]) .args(&["shaders/shader.vert", "-Os", "-o", "shaders/vert.spv"])
.output() .output()
.expect("failed to execute vert process"); .expect("failed to execute vert process");
} else {
out = Command::new("glslc")
.args(&["shaders/shader.vert", "-Os", "-o", "shaders/vert.spv"])
.output()
.expect("failed to execute vert process");
}
println!("{}", String::from_utf8(out.stderr).unwrap()); println!("{}", String::from_utf8(out.stderr).unwrap());
println!("{}", String::from_utf8(out.stdout).unwrap()); println!("{}", String::from_utf8(out.stdout).unwrap());
let out = Command::new("glslc.exe") let out;
if cfg!(windows) {
out = Command::new("glslc.exe")
.args(&["shaders/shader.frag", "-Os", "-o", "shaders/frag.spv"]) .args(&["shaders/shader.frag", "-Os", "-o", "shaders/frag.spv"])
.output() .output()
.expect("failed to execute frag process"); .expect("failed to execute frag process");
} else {
out = Command::new("glslc")
.args(&["shaders/shader.frag", "-Os", "-o", "shaders/frag.spv"])
.output()
.expect("failed to execute frag process");
}
println!("{}", String::from_utf8(out.stderr).unwrap()); println!("{}", String::from_utf8(out.stderr).unwrap());
println!("{}", String::from_utf8(out.stdout).unwrap()); println!("{}", String::from_utf8(out.stdout).unwrap());
println!(r"cargo:rustc-link-search=.");
} }
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.