File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1004,10 +1004,19 @@ fn envify(name: &str) -> String {
1004
1004
1005
1005
/// System libraries should only be linked dynamically
1006
1006
fn is_static_available ( name : & str , system_roots : & [ PathBuf ] , dirs : & [ PathBuf ] ) -> bool {
1007
- let libname = format ! ( "lib{}.a" , name) ;
1007
+ let libnames = {
1008
+ let mut names = vec ! [ format!( "lib{}.a" , name) ] ;
1009
+
1010
+ if cfg ! ( target_os = "windows" ) {
1011
+ names. push ( format ! ( "{}.lib" , name) ) ;
1012
+ }
1013
+
1014
+ names
1015
+ } ;
1008
1016
1009
1017
dirs. iter ( ) . any ( |dir| {
1010
- !system_roots. iter ( ) . any ( |sys| dir. starts_with ( sys) ) && dir. join ( & libname) . exists ( )
1018
+ let library_exists = libnames. iter ( ) . any ( |libname| dir. join ( & libname) . exists ( ) ) ;
1019
+ library_exists && !system_roots. iter ( ) . any ( |sys| dir. starts_with ( sys) )
1011
1020
} )
1012
1021
}
1013
1022
You can’t perform that action at this time.
0 commit comments