Skip to content

Commit

Permalink
Weird hack
Browse files Browse the repository at this point in the history
  • Loading branch information
vlovich committed Jan 31, 2025
1 parent ef17b3d commit 32628f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions llama-cpp-sys-2/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ fn extract_lib_names(out_dir: &Path, build_shared_libs: bool) -> Vec<String> {
let lib_name = if stem_str.starts_with("lib") {
stem_str.strip_prefix("lib").unwrap_or(stem_str)
} else {
if path.extension() == Some(std::ffi::OsStr::new("a")) {
// panic!("renaming {:?} to {:?}", &path, path.join(format!("lib{}.a", stem_str)));
let target = path.parent().unwrap().join(format!("lib{}.a", stem_str));
std::fs::rename(&path, &target).unwrap_or_else(|e| {
panic!("Failed to rename {path:?} to {target:?}: {e:?}");
})
}
stem_str
};
lib_names.push(lib_name.to_string());
Expand Down

0 comments on commit 32628f1

Please sign in to comment.