@@ -95,14 +95,14 @@ pub fn try_find_native_static_library(
95
95
name : & str ,
96
96
verbatim : bool ,
97
97
) -> Option < PathBuf > {
98
+ let default = sess. staticlib_components ( verbatim) ;
98
99
let formats = if verbatim {
99
- vec ! [ ( "" . into ( ) , "" . into ( ) ) ]
100
+ vec ! [ default ]
100
101
} else {
101
- let os = ( sess. target . staticlib_prefix . clone ( ) , sess. target . staticlib_suffix . clone ( ) ) ;
102
102
// On Windows, static libraries sometimes show up as libfoo.a and other
103
103
// times show up as foo.lib
104
- let unix = ( "lib" . into ( ) , ".a" . into ( ) ) ;
105
- if os == unix { vec ! [ os ] } else { vec ! [ os , unix] }
104
+ let unix = ( "lib" , ".a" ) ;
105
+ if default == unix { vec ! [ default ] } else { vec ! [ default , unix] }
106
106
} ;
107
107
108
108
walk_native_lib_search_dirs ( sess, None , |dir, is_framework| {
@@ -124,18 +124,17 @@ pub fn try_find_native_dynamic_library(
124
124
name : & str ,
125
125
verbatim : bool ,
126
126
) -> Option < PathBuf > {
127
+ let default = sess. staticlib_components ( verbatim) ;
127
128
let formats = if verbatim {
128
- vec ! [ ( "" . into ( ) , "" . into ( ) ) ]
129
+ vec ! [ default ]
129
130
} else {
130
131
// While the official naming convention for MSVC import libraries
131
- // is foo.lib...
132
- let os = ( sess. target . staticlib_prefix . clone ( ) , sess. target . staticlib_suffix . clone ( ) ) ;
133
- // ... Meson follows the libfoo.dll.a convention to
132
+ // is foo.lib, Meson follows the libfoo.dll.a convention to
134
133
// disambiguate .a for static libraries
135
- let meson = ( "lib" . into ( ) , ".dll.a" . into ( ) ) ;
134
+ let meson = ( "lib" , ".dll.a" ) ;
136
135
// and MinGW uses .a altogether
137
- let mingw = ( "lib" . into ( ) , ".a" . into ( ) ) ;
138
- vec ! [ os , meson, mingw]
136
+ let mingw = ( "lib" , ".a" ) ;
137
+ vec ! [ default , meson, mingw]
139
138
} ;
140
139
141
140
walk_native_lib_search_dirs ( sess, None , |dir, is_framework| {
0 commit comments