Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/walkdir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2019-06-06 02:01:37 +0300
committerAndrew Gallant <jamslam@gmail.com>2020-01-28 04:27:58 +0300
commit1d7293a5a1ef548ce587a0b08abce5f21571a100 (patch)
tree891328e6665280fbfbbd15351b829c04a237b054 /build.rs
parente4bd92f6a791f35593185539d91f9516161ab5ac (diff)
progressag/sys
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/build.rs b/build.rs
index 9f26302..de9ae04 100644
--- a/build.rs
+++ b/build.rs
@@ -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");
+ }
+}