Skip to content

Commit cc29381

Browse files
committed
spirv-builder: also search cwd for dylib
1 parent 89017e5 commit cc29381

File tree

1 file changed

+7
-2
lines changed
  • crates/spirv-builder/src

1 file changed

+7
-2
lines changed

crates/spirv-builder/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,10 +753,14 @@ fn dylib_path_envvar() -> &'static str {
753753
}
754754
}
755755
fn dylib_path() -> Vec<PathBuf> {
756-
match env::var_os(dylib_path_envvar()) {
756+
let mut dylibs = match env::var_os(dylib_path_envvar()) {
757757
Some(var) => env::split_paths(&var).collect(),
758758
None => Vec::new(),
759+
};
760+
if let Ok(dir) = env::current_dir() {
761+
dylibs.push(dir);
759762
}
763+
dylibs
760764
}
761765

762766
fn find_rustc_codegen_spirv() -> Result<PathBuf, SpirvBuilderError> {
@@ -766,7 +770,8 @@ fn find_rustc_codegen_spirv() -> Result<PathBuf, SpirvBuilderError> {
766770
env::consts::DLL_PREFIX,
767771
env::consts::DLL_SUFFIX
768772
);
769-
for mut path in dylib_path() {
773+
let dylib_paths = dylib_path();
774+
for mut path in dylib_paths {
770775
path.push(&filename);
771776
if path.is_file() {
772777
return Ok(path);

0 commit comments

Comments
 (0)