Skip to content

Commit

Permalink
fix cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
shiinamiyuki committed Apr 11, 2024
1 parent 32739a0 commit 74c0d75
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions luisa_compute_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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| {
Expand Down

0 comments on commit 74c0d75

Please sign in to comment.