Skip to content

Commit 309e809

Browse files
LegNeatoFirestar99
authored andcommitted
spirv-builder: pass -Zjson-target-spec for JSON targets
1 parent 91fa3f5 commit 309e809

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • crates/spirv-builder/src

crates/spirv-builder/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,12 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
10471047

10481048
let target_spec_dir = target_dir.join("target-specs");
10491049
let target = TargetSpecVersion::target_arg(toolchain_rustc_version, &target, &target_spec_dir)?;
1050+
if Path::new(&target)
1051+
.extension()
1052+
.is_some_and(|ext| ext == "json")
1053+
{
1054+
cargo.arg("-Zjson-target-spec");
1055+
}
10501056
cargo.arg("--target").arg(target);
10511057

10521058
if !builder.shader_crate_features.default_features {

0 commit comments

Comments
 (0)