diff options
author | Andrew Gallant <jamslam@gmail.com> | 2019-06-06 02:01:37 +0300 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2020-01-28 04:27:58 +0300 |
commit | 1d7293a5a1ef548ce587a0b08abce5f21571a100 (patch) | |
tree | 891328e6665280fbfbbd15351b829c04a237b054 /build.rs | |
parent | e4bd92f6a791f35593185539d91f9516161ab5ac (diff) |
progressag/sys
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1,9 +1,25 @@ #[cfg(not(target_os = "dragonfly"))] -fn main() {} +fn main() { + enable_getdents(); +} #[cfg(target_os = "dragonfly")] fn main() { + enable_getdents(); cc::Build::new() .file("src/os/unix/errno-dragonfly.c") .compile("errno-dragonfly"); } + +fn enable_getdents() { + if std::env::var_os("CARGO_CFG_WALKDIR_DISABLE_GETDENTS").is_some() { + return; + } + let os = match std::env::var("CARGO_CFG_TARGET_OS") { + Err(_) => return, + Ok(os) => os, + }; + if os == "linux" { + println!("cargo:rustc-cfg=walkdir_getdents"); + } +} |