| 1 |
use cfg_aliases::cfg_aliases; |
| 2 |
|
| 3 |
fn main() { |
| 4 |
cfg_aliases! { |
| 5 |
android: { target_os = "android" }, |
| 6 |
dragonfly: { target_os = "dragonfly" }, |
| 7 |
ios: { target_os = "ios" }, |
| 8 |
freebsd: { target_os = "freebsd" }, |
| 9 |
illumos: { target_os = "illumos" }, |
| 10 |
linux: { target_os = "linux" }, |
| 11 |
macos: { target_os = "macos" }, |
| 12 |
netbsd: { target_os = "netbsd" }, |
| 13 |
openbsd: { target_os = "openbsd" }, |
| 14 |
solaris: { target_os = "solaris" }, |
| 15 |
watchos: { target_os = "watchos" }, |
| 16 |
tvos: { target_os = "tvos" }, |
| 17 |
visionos: { target_os = "visionos" }, |
| 18 |
|
| 19 |
|
| 20 |
// cfg aliases we would like to use |
| 21 |
apple_targets: { any(ios, macos, watchos, tvos, visionos) }, |
| 22 |
bsd: { any(freebsd, dragonfly, netbsd, openbsd, apple_targets) }, |
| 23 |
bsd_without_apple: { any(freebsd, dragonfly, netbsd, openbsd) }, |
| 24 |
linux_android: { any(android, linux) }, |
| 25 |
freebsdlike: { any(dragonfly, freebsd) }, |
| 26 |
netbsdlike: { any(netbsd, openbsd) }, |
| 27 |
solarish: { any(illumos, solaris) }, |
| 28 |
} |
| 29 |
|
| 30 |
// Below are custom cfg values set during some CI steps. |
| 31 |
println!("cargo:rustc-check-cfg=cfg(fbsd14)"); |
| 32 |
println!("cargo:rustc-check-cfg=cfg(qemu)"); |
| 33 |
// Cygwin target, added in 1.86 |
| 34 |
println!("cargo:rustc-check-cfg=cfg(target_os, values(\"cygwin\"))"); |
| 35 |
} |