Skip to content

Commit

Permalink
Remove usage of cfg! from the build script
Browse files Browse the repository at this point in the history
  • Loading branch information
nathaniel-daniel committed Nov 27, 2023
1 parent a356120 commit 2fa2d26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libssh-rs-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn main() {
let openssl_version = u64::from_str_radix(&openssl_version, 16).unwrap();

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

if cfg!(unix) {
if target_family == "unix" {
cfg.file("vendored/src/threads/pthread.c");
}
if cfg!(windows) {
if target_family == "windows" {
cfg.file("vendored/src/threads/winlocks.c");
}
cfg.compile("libssh");
Expand Down

0 comments on commit 2fa2d26

Please sign in to comment.