Skip to content

Commit 0baf910

Browse files
nathaniel-danielwez
authored andcommitted
Remove usage of cfg! from the build script
1 parent a356120 commit 0baf910

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libssh-rs-sys/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ fn main() {
2929
let openssl_version = u64::from_str_radix(&openssl_version, 16).unwrap();
3030

3131
let target = std::env::var("TARGET").unwrap();
32+
let target_family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
3233
cfg.define("GLOBAL_CLIENT_CONFIG", Some("\"/etc/ssh/ssh_config\""));
3334
cfg.define(
3435
"GLOBAL_BIND_CONFIG",
@@ -240,10 +241,10 @@ fn main() {
240241
cfg.file(&format!("vendored/src/{}", f));
241242
}
242243

243-
if cfg!(unix) {
244+
if target_family == "unix" {
244245
cfg.file("vendored/src/threads/pthread.c");
245246
}
246-
if cfg!(windows) {
247+
if target_family == "windows" {
247248
cfg.file("vendored/src/threads/winlocks.c");
248249
}
249250
cfg.compile("libssh");

0 commit comments

Comments
 (0)