Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit f581111

Browse files
sdroegebilelmoussaoui
authored andcommitted
gio: Actually fix pkg-config names properly
1 parent b4134a8 commit f581111

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

gio/sys/tests/abi.rs

+16-10
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use std::process::Command;
1414
use std::str;
1515
use tempfile::Builder;
1616

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"];
1919

2020
#[derive(Clone, Debug)]
2121
struct Compiler {
@@ -132,10 +132,13 @@ fn cross_validate_constants_with_c() {
132132
.prefix("abi")
133133
.tempdir()
134134
.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");
139142

140143
assert_eq!(
141144
"1",
@@ -175,10 +178,13 @@ fn cross_validate_layout_with_c() {
175178
.prefix("abi")
176179
.tempdir()
177180
.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");
182188

183189
assert_eq!(
184190
Layout {

0 commit comments

Comments
 (0)