Use rustc-check-cfg (#3682)
This commit is contained in:
parent
7f8771a362
commit
16fd2baba0
3 changed files with 22 additions and 4 deletions
15
build.rs
15
build.rs
|
|
@ -21,4 +21,19 @@ fn main() {
|
||||||
wayland_platform: { all(feature = "wayland", free_unix, not(redox)) },
|
wayland_platform: { all(feature = "wayland", free_unix, not(redox)) },
|
||||||
orbital_platform: { redox },
|
orbital_platform: { redox },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(android_platform)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(web_platform)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(macos_platform)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(ios_platform)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(windows_platform)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(apple)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(free_unix)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(redox)");
|
||||||
|
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(x11_platform)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(wayland_platform)");
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(orbital_platform)");
|
||||||
|
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(unreleased_changelogs)");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,11 +103,14 @@ impl<T> EventLoopBuilder<T> {
|
||||||
///
|
///
|
||||||
/// [`platform`]: crate::platform
|
/// [`platform`]: crate::platform
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
android,
|
android_platform,
|
||||||
doc = "[`.with_android_app(app)`]: \
|
doc = "[`.with_android_app(app)`]: \
|
||||||
crate::platform::android::EventLoopBuilderExtAndroid::with_android_app"
|
crate::platform::android::EventLoopBuilderExtAndroid::with_android_app"
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(not(android), doc = "[`.with_android_app(app)`]: #only-available-on-android")]
|
#[cfg_attr(
|
||||||
|
not(android_platform),
|
||||||
|
doc = "[`.with_android_app(app)`]: #only-available-on-android"
|
||||||
|
)]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn build(&mut self) -> Result<EventLoop<T>, EventLoopError> {
|
pub fn build(&mut self) -> Result<EventLoop<T>, EventLoopError> {
|
||||||
let _span = tracing::debug_span!("winit::EventLoopBuilder::build").entered();
|
let _span = tracing::debug_span!("winit::EventLoopBuilder::build").entered();
|
||||||
|
|
|
||||||
|
|
@ -476,10 +476,10 @@ pub trait WindowAttributesExtWindows {
|
||||||
/// the menus look. If you use this, it is recommended that you combine it with
|
/// the menus look. If you use this, it is recommended that you combine it with
|
||||||
/// `with_theme(Some(Theme::Light))` to avoid a jarring effect.
|
/// `with_theme(Some(Theme::Light))` to avoid a jarring effect.
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
platform_windows,
|
windows_platform,
|
||||||
doc = "[`CreateMenu`]: windows_sys::Win32::UI::WindowsAndMessaging::CreateMenu"
|
doc = "[`CreateMenu`]: windows_sys::Win32::UI::WindowsAndMessaging::CreateMenu"
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(not(platform_windows), doc = "[`CreateMenu`]: #only-available-on-windows")]
|
#[cfg_attr(not(windows_platform), doc = "[`CreateMenu`]: #only-available-on-windows")]
|
||||||
fn with_menu(self, menu: HMENU) -> Self;
|
fn with_menu(self, menu: HMENU) -> Self;
|
||||||
|
|
||||||
/// This sets `ICON_BIG`. A good ceiling here is 256x256.
|
/// This sets `ICON_BIG`. A good ceiling here is 256x256.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue