Open
Description
openedon Mar 7, 2023
I have made a patch to fix it.
fn is_static_available(name: &str, system_roots: &[PathBuf], dirs: &[PathBuf]) -> bool {
let libname = format!("lib{}.a", name);
let libname_win = if cfg!(windows) {
format!("{}.lib", name)
} else {
Default::default()
};
dirs.iter().any(|dir| {
!system_roots.iter().any(|sys| dir.starts_with(sys))
&& (dir.join(&libname).exists()
|| (!libname_win.is_empty() && dir.join(&libname_win).exists()))
})
}
diff --git a/src/lib.rs b/src/lib.rs
index 2c690fa..a5df218 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -832,9 +832,16 @@ fn envify(name: &str) -> String {
/// System libraries should only be linked dynamically
fn is_static_available(name: &str, system_roots: &[PathBuf], dirs: &[PathBuf]) -> bool {
let libname = format!("lib{}.a", name);
+ let libname_win = if cfg!(windows) {
+ format!("{}.lib", name)
+ } else {
+ Default::default()
+ };
dirs.iter().any(|dir| {
- !system_roots.iter().any(|sys| dir.starts_with(sys)) && dir.join(&libname).exists()
+ !system_roots.iter().any(|sys| dir.starts_with(sys))
+ && (dir.join(&libname).exists()
+ || (!libname_win.is_empty() && dir.join(&libname_win).exists()))
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels