2022-12-25 09:57:27 +02:00
|
|
|
use cfg_aliases::cfg_aliases;
|
|
|
|
|
|
|
|
|
|
fn main() {
|
2024-05-22 15:51:29 +04:00
|
|
|
// The script doesn't depend on our code.
|
2023-01-29 14:23:45 +03:00
|
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
|
|
|
|
2024-05-22 15:51:29 +04:00
|
|
|
// Setup cfg aliases.
|
2022-12-25 09:57:27 +02:00
|
|
|
cfg_aliases! {
|
|
|
|
|
// Systems.
|
|
|
|
|
android_platform: { target_os = "android" },
|
2024-01-14 18:54:52 +01:00
|
|
|
web_platform: { all(target_family = "wasm", target_os = "unknown") },
|
2022-12-25 09:57:27 +02:00
|
|
|
macos_platform: { target_os = "macos" },
|
2024-06-24 13:26:49 +02:00
|
|
|
ios_platform: { all(target_vendor = "apple", not(target_os = "macos")) },
|
2022-12-25 09:57:27 +02:00
|
|
|
windows_platform: { target_os = "windows" },
|
2024-06-24 13:26:49 +02:00
|
|
|
free_unix: { all(unix, not(target_vendor = "apple"), not(android_platform), not(target_os = "emscripten")) },
|
2023-01-05 06:58:08 -07:00
|
|
|
redox: { target_os = "redox" },
|
2022-12-25 09:57:27 +02:00
|
|
|
|
|
|
|
|
// Native displays.
|
2024-01-14 18:54:52 +01:00
|
|
|
x11_platform: { all(feature = "x11", free_unix, not(redox)) },
|
|
|
|
|
wayland_platform: { all(feature = "wayland", free_unix, not(redox)) },
|
2023-01-05 06:58:08 -07:00
|
|
|
orbital_platform: { redox },
|
2022-12-25 09:57:27 +02:00
|
|
|
}
|
2024-05-06 07:11:57 +02:00
|
|
|
|
2024-05-22 15:51:29 +04:00
|
|
|
// Winit defined cfgs.
|
2024-05-06 07:11:57 +02:00
|
|
|
println!("cargo:rustc-check-cfg=cfg(unreleased_changelogs)");
|
2022-12-25 09:57:27 +02:00
|
|
|
}
|