Skip to content

Commit

Permalink
Don't use /usr as fallback sysroot on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Sep 4, 2020
1 parent 81468be commit e94a533
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,17 @@ impl Library {
let sysroot = config
.env_var_os("PKG_CONFIG_SYSROOT_DIR")
.or_else(|| config.env_var_os("SYSROOT"))
.map(PathBuf::from)
.unwrap_or_else(|| PathBuf::from("/usr"));
vec![sysroot]
.map(PathBuf::from);

if cfg!(target_os = "windows") {
if let Some(sysroot) = sysroot {
vec![sysroot]
} else {
vec![]
}
} else {
vec![sysroot.unwrap_or_else(|| PathBuf::from("/usr"))]
}
};

let words = split_flags(output);
Expand Down

0 comments on commit e94a533

Please sign in to comment.