@@ -95,14 +95,14 @@ pub fn try_find_native_static_library(
9595 name : & str ,
9696 verbatim : bool ,
9797) -> Option < PathBuf > {
98+ let default = sess. staticlib_components ( verbatim) ;
9899 let formats = if verbatim {
99- vec ! [ ( "" . into ( ) , "" . into ( ) ) ]
100+ vec ! [ default ]
100101 } else {
101- let os = ( sess. target . staticlib_prefix . clone ( ) , sess. target . staticlib_suffix . clone ( ) ) ;
102102 // On Windows, static libraries sometimes show up as libfoo.a and other
103103 // 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] }
106106 } ;
107107
108108 walk_native_lib_search_dirs ( sess, None , |dir, is_framework| {
@@ -124,18 +124,17 @@ pub fn try_find_native_dynamic_library(
124124 name : & str ,
125125 verbatim : bool ,
126126) -> Option < PathBuf > {
127+ let default = sess. staticlib_components ( verbatim) ;
127128 let formats = if verbatim {
128- vec ! [ ( "" . into ( ) , "" . into ( ) ) ]
129+ vec ! [ default ]
129130 } else {
130131 // 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
134133 // disambiguate .a for static libraries
135- let meson = ( "lib" . into ( ) , ".dll.a" . into ( ) ) ;
134+ let meson = ( "lib" , ".dll.a" ) ;
136135 // 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]
139138 } ;
140139
141140 walk_native_lib_search_dirs ( sess, None , |dir, is_framework| {
0 commit comments