|
fn is_static_available(name: &str, dirs: &[PathBuf]) -> bool { |
|
let libname = format!("lib{}.a", name); |
|
let system_roots = if cfg!(target_os = "macos") { |
|
vec![Path::new("/Library"), Path::new("/System")] |
|
} else { |
|
vec![Path::new("/usr")] |
|
}; |
|
|
|
dirs.iter().any(|dir| { |
|
!system_roots.iter().any(|sys| dir.starts_with(sys)) && dir.join(&libname).exists() |
|
}) |
|
} |
Basically any library which falls into /usr/lib/ won't be statically linked (which is basically all libraries found by pkg-config). Why is this logic there?
pkg-config-rs/src/lib.rs
Lines 570 to 581 in ef356f3
Basically any library which falls into
/usr/lib/won't be statically linked (which is basically all libraries found by pkg-config). Why is this logic there?