| 1 |
fn main() { |
| 2 |
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); |
| 3 |
let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap(); |
| 4 |
|
| 5 |
println!("cargo:rustc-check-cfg=cfg(target_os, values(\"switch\",\"qurt\"))"); |
| 6 |
|
| 7 |
let has_prlimit64 = (target_os == "android" && target_env != "newlib") |
| 8 |
|| (target_os == "linux" |
| 9 |
&& (target_env == "gnu" || target_env == "musl" || target_env == "ohos")); |
| 10 |
println!("cargo:rustc-check-cfg=cfg(rlimit__has_prlimit64)"); |
| 11 |
if has_prlimit64 { |
| 12 |
println!("cargo:rustc-cfg=rlimit__has_prlimit64"); |
| 13 |
} |
| 14 |
|
| 15 |
let get_kern_max_files_per_proc = (target_os == "dragonfly" |
| 16 |
|| target_os == "freebsd" |
| 17 |
|| target_os == "ios" |
| 18 |
|| target_os == "macos" |
| 19 |
|| target_os == "tvos" |
| 20 |
|| target_os == "visionos" |
| 21 |
|| target_os == "watchos") |
| 22 |
&& target_env != "newlib"; |
| 23 |
println!("cargo:rustc-check-cfg=cfg(rlimit__get_kern_max_files_per_proc)"); |
| 24 |
if get_kern_max_files_per_proc { |
| 25 |
println!("cargo:rustc-cfg=rlimit__get_kern_max_files_per_proc"); |
| 26 |
} |
| 27 |
} |