Skip to content

Commit 88d93b3

Browse files
committed
Merge pull request #21 from SuperHeron/master
Use PKG_CONFIG environment variable
2 parents e493197 + 4a189a0 commit 88d93b3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ impl Config {
328328
}
329329

330330
fn command(&self, name: &str, args: &[&str]) -> Command {
331-
let mut cmd = Command::new("pkg-config");
331+
let exe = env::var("PKG_CONFIG").unwrap_or(String::from("pkg-config"));
332+
let mut cmd = Command::new(exe);
332333
if self.is_static(name) {
333334
cmd.arg("--static");
334335
}

tests/test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ static LOCK: StaticMutex = MUTEX_INIT;
1111

1212
fn reset() {
1313
for (k, _) in env::vars() {
14-
if k.contains("PKG_CONFIG") || k.contains("DYNAMIC") ||
15-
k.contains("STATIC") {
14+
if k.contains("DYNAMIC") ||
15+
k.contains("STATIC") ||
16+
k.contains("PKG_CONFIG_ALLOW_CROSS") ||
17+
k.contains("FOO_NO_PKG_CONFIG") {
1618
env::remove_var(&k);
1719
}
1820
}

0 commit comments

Comments
 (0)