From 74c0d7567c0d9cbacb601a94be401f285510dfa5 Mon Sep 17 00:00:00 2001 From: Xiaochun Tong Date: Thu, 11 Apr 2024 14:16:20 -0400 Subject: [PATCH] fix cuda --- luisa_compute_sys/build.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/luisa_compute_sys/build.rs b/luisa_compute_sys/build.rs index 0b353d6..367ceff 100644 --- a/luisa_compute_sys/build.rs +++ b/luisa_compute_sys/build.rs @@ -84,7 +84,13 @@ fn cmake_build() -> PathBuf { config.build() } -fn is_path_dll(path: &PathBuf) -> bool { +fn need_copy(path: &PathBuf) -> bool { + if let Some(f) = path.file_name() { + let f = f.to_str().unwrap(); + if f == "luisa_nvtrc" || f == "luisa_nvrtc.exe" { + return true; + } + } let basic_check = path.extension().is_some() && (path.extension().unwrap() == "dll" || path.extension().unwrap() == "lib" // lib is also need on Windows for linking DLLs @@ -113,7 +119,7 @@ fn copy_dlls(out_dir: &PathBuf) { for entry in std::fs::read_dir(out_dir).unwrap() { let entry = entry.unwrap(); let path = entry.path(); - if is_path_dll(&path) { + if need_copy(&path) { // let target_dir = get_output_path(); let comps: Vec<_> = path.components().collect(); let copy_if_different = |src, dst| {