Skip to content

Commit 94e8321

Browse files
committed
try to determine path relative to shader crate, but don't force it
1 parent 4493eda commit 94e8321

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

crates/cargo-gpu/src/build.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ impl Build {
110110
path.display(),
111111
self.install.spirv_install.shader_crate.display()
112112
);
113-
let path_relative_to_shader_crate = path
114-
.relative_to(&self.install.spirv_install.shader_crate)?
115-
.to_path("");
116-
Ok(Linkage::new(entry, path_relative_to_shader_crate))
113+
let spv_path = path
114+
.relative_to(&self.install.spirv_install.shader_crate)
115+
.map_or(path, |path_relative_to_shader_crate| {
116+
path_relative_to_shader_crate.to_path("")
117+
});
118+
Ok(Linkage::new(entry, spv_path))
117119
},
118120
)
119121
.collect::<anyhow::Result<Vec<Linkage>>>()?;

0 commit comments

Comments
 (0)