-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.rs
26 lines (24 loc) · 1.07 KB
/
build.rs
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
26
fn main() {
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
println!("cargo:rustc-check-cfg=cfg(target_os, values(\"switch\"))");
let has_prlimit64 = (target_os == "android" && target_env != "newlib")
|| ((target_env == "gnu" || target_env == "musl" || target_env == "ohos")
&& (target_os == "l4re" || target_os == "linux"));
println!("cargo:rustc-check-cfg=cfg(rlimit__has_prlimit64)");
if has_prlimit64 {
println!("cargo:rustc-cfg=rlimit__has_prlimit64");
}
let get_kern_max_files_per_proc = (target_os == "dragonfly"
|| target_os == "freebsd"
|| target_os == "ios"
|| target_os == "macos"
|| target_os == "tvos"
|| target_os == "visionos"
|| target_os == "watchos")
&& target_env != "newlib";
println!("cargo:rustc-check-cfg=cfg(rlimit__get_kern_max_files_per_proc)");
if get_kern_max_files_per_proc {
println!("cargo:rustc-cfg=rlimit__get_kern_max_files_per_proc");
}
}