Skip to content

Commit 92036b0

Browse files
committed
Fix: include the correct paths for libnvvm on linux
1 parent 54cce37 commit 92036b0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

crates/cuda_builder/src/lib.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,15 @@ fn find_rustc_codegen_nvvm() -> PathBuf {
283283
fn get_new_path_var() -> OsString {
284284
let split_paths = env::var_os(dylib_path_envvar()).unwrap_or_default();
285285
let mut paths = env::split_paths(&split_paths).collect::<Vec<_>>();
286-
let libnvvm_path = find_cuda_helper::find_cuda_root()
287-
.unwrap()
288-
.join("nvvm")
289-
.join("bin");
290-
paths.push(libnvvm_path);
286+
let possible_paths = if cfg!(target_os = "windows") {
287+
vec![find_cuda_helper::find_cuda_root()
288+
.unwrap()
289+
.join("nvvm")
290+
.join("bin")]
291+
} else {
292+
find_cuda_helper::find_cuda_lib_dirs()
293+
};
294+
paths.extend(possible_paths);
291295
env::join_paths(&paths).expect("Failed to join paths for PATH")
292296
}
293297

0 commit comments

Comments
 (0)