fix up the builder so that this works as a nix expression
This commit is contained in:
@@ -37,7 +37,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
println!("target_dir: {:?}", target_dir);
|
||||
println!("manifest_path: {:?}", manifest_path);
|
||||
|
||||
let status = std::process::Command::new("cargo")
|
||||
let output = std::process::Command::new("cargo")
|
||||
.args([
|
||||
"run",
|
||||
"--release",
|
||||
@@ -47,14 +47,11 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
.arg("--target-dir")
|
||||
.arg(target_dir)
|
||||
.stderr(std::process::Stdio::inherit())
|
||||
.stdout(std::process::Stdio::inherit())
|
||||
.status()?;
|
||||
if !status.success() {
|
||||
if let Some(code) = status.code() {
|
||||
std::process::exit(code);
|
||||
} else {
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
.output()?;
|
||||
|
||||
let stdout = String::from_utf8(output.stdout)?;
|
||||
let mod_path = stdout.trim_end().rsplit("\n").next().expect("spirv module path");
|
||||
println!("stdout: {}", stdout);
|
||||
println!("cargo:rustc-env=SPIRV_MODULE_PATH={}", mod_path);
|
||||
Ok(())
|
||||
}
|
||||
|
@@ -3,6 +3,6 @@
|
||||
pub fn spirv_module() -> &'static [u8] {
|
||||
// we specifically include the bytes into this binary, for ease of packaging (v.s. attempting
|
||||
// to locate the compiled result at runtime).
|
||||
include_bytes!("../../../target/spirv-builder/spirv-unknown-vulkan1.1/release/deps/spirv_backend.spv.dir/module")
|
||||
include_bytes!(std::env!("SPIRV_MODULE_PATH"))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user