???
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
[target.'cfg(target_os = "windows")']
|
||||||
|
linker = "link.exe"
|
||||||
@@ -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=.");
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user