@@ -14,8 +14,8 @@ use std::process::Command;
14
14
use std:: str;
15
15
use tempfile:: Builder ;
16
16
17
- static PACKAGES : & [ & str ] = & [ "gio-2.0" ] ;
18
- static PACKAGES_FALLBACK : & [ & str ] = & [ "gio-2.0-unix" , "glib -2.0"] ;
17
+ static PACKAGES_UNIX : & [ & str ] = & [ "gio-2.0" , "gio-unix -2.0"] ;
18
+ static PACKAGES_WINDOWS : & [ & str ] = & [ "gio-2.0" ] ;
19
19
20
20
#[ derive( Clone , Debug ) ]
21
21
struct Compiler {
@@ -132,10 +132,13 @@ fn cross_validate_constants_with_c() {
132
132
. prefix ( "abi" )
133
133
. tempdir ( )
134
134
. expect ( "temporary directory" ) ;
135
- let cc = match Compiler :: new ( PACKAGES ) {
136
- Ok ( cc) => Ok ( cc) ,
137
- Err ( _) => Compiler :: new ( PACKAGES_FALLBACK ) ,
138
- } . expect ( "configured compiler" ) ;
135
+
136
+ let cc = if cfg ! ( target_family = "windows" ) {
137
+ Compiler :: new ( PACKAGES_WINDOWS )
138
+ } else {
139
+ Compiler :: new ( PACKAGES_UNIX )
140
+ }
141
+ . expect ( "configured compiler" ) ;
139
142
140
143
assert_eq ! (
141
144
"1" ,
@@ -175,10 +178,13 @@ fn cross_validate_layout_with_c() {
175
178
. prefix ( "abi" )
176
179
. tempdir ( )
177
180
. expect ( "temporary directory" ) ;
178
- let cc = match Compiler :: new ( PACKAGES ) {
179
- Ok ( cc) => Ok ( cc) ,
180
- Err ( _) => Compiler :: new ( PACKAGES_FALLBACK ) ,
181
- } . expect ( "configured compiler" ) ;
181
+
182
+ let cc = if cfg ! ( target_family = "windows" ) {
183
+ Compiler :: new ( PACKAGES_WINDOWS )
184
+ } else {
185
+ Compiler :: new ( PACKAGES_UNIX )
186
+ }
187
+ . expect ( "configured compiler" ) ;
182
188
183
189
assert_eq ! (
184
190
Layout {
0 commit comments