Skip to content

Commit

Permalink
Merge pull request #561 from AsbjornOlling/fix-build-on-nixos
Browse files Browse the repository at this point in the history
build.rs: also search for library files in lib64/
  • Loading branch information
MarcusDunn authored Oct 28, 2024
2 parents c936083 + d9475cc commit 372d67a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions llama-cpp-sys-2/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn extract_lib_names(out_dir: &Path, build_shared_libs: bool) -> Vec<String> {
"*.a"
}
};
let libs_dir = out_dir.join("lib");
let libs_dir = out_dir.join("lib*");
let pattern = libs_dir.join(lib_pattern);
debug_log!("Extract libs {}", pattern.display());

Expand Down Expand Up @@ -265,11 +265,13 @@ fn main() {

// Search paths
println!("cargo:rustc-link-search={}", out_dir.join("lib").display());
println!("cargo:rustc-link-search={}", out_dir.join("lib64").display());
println!("cargo:rustc-link-search={}", build_dir.display());

// Link libraries
let llama_libs_kind = if build_shared_libs { "dylib" } else { "static" };
let llama_libs = extract_lib_names(&out_dir, build_shared_libs);
assert_ne!(llama_libs.len(), 0);

for lib in llama_libs {
debug_log!(
Expand Down Expand Up @@ -349,4 +351,4 @@ fn main() {
}
}
}
}
}

0 comments on commit 372d67a

Please sign in to comment.