From eb558bbf77d31c18e1a3ed87324d097cb4ebb4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Wed, 6 Nov 2024 14:14:12 +0100 Subject: [PATCH] properly flag using `CustomCursor::Url` in wasm (#16255) # Objective - Fixes #16254 - fix building in wasm without custom_cursor ## Solution - Properly flag `CustomCursor::Url` which only exist in wasm, but also only when `custom_cursor` is enabled ## Testing - `cargo check --target wasm32-unknown-unknown -p bevy_winit` --- crates/bevy_winit/src/cursor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/bevy_winit/src/cursor.rs b/crates/bevy_winit/src/cursor.rs index 63e298c0c0..9cc2639091 100644 --- a/crates/bevy_winit/src/cursor.rs +++ b/crates/bevy_winit/src/cursor.rs @@ -154,7 +154,11 @@ fn update_cursors( CursorSource::Custom((cache_key, source)) } } - #[cfg(all(target_family = "wasm", target_os = "unknown"))] + #[cfg(all( + feature = "custom_cursor", + target_family = "wasm", + target_os = "unknown" + ))] CursorIcon::Custom(CustomCursor::Url { url, hotspot }) => { let cache_key = CustomCursorCacheKey::Url(url.clone());