blob: de9ae04a99e787faa56201399fa24dbb46d134b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#[cfg(not(target_os = "dragonfly"))]
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");
}
}
|