From c1fc9213c3fe9e1a034e42515b5db647cd2313b0 Mon Sep 17 00:00:00 2001 From: Simon Frankau Date: Mon, 29 Apr 2024 09:33:23 +0100 Subject: [PATCH] Enable egui_glow's winit feature on wasm (#4420) (#4421) Reverts change in #1303, enabling the egui_glow::winit module when using wasm. * Closes --- crates/egui_glow/Cargo.toml | 2 +- crates/egui_glow/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/egui_glow/Cargo.toml b/crates/egui_glow/Cargo.toml index 6bb081980d3..44939640cfb 100644 --- a/crates/egui_glow/Cargo.toml +++ b/crates/egui_glow/Cargo.toml @@ -54,6 +54,7 @@ x11 = ["winit?/x11"] [dependencies] egui = { workspace = true, default-features = false, features = ["bytemuck"] } +egui-winit = { workspace = true, optional = true, default-features = false } bytemuck = "1.7" glow.workspace = true @@ -66,7 +67,6 @@ document-features = { workspace = true, optional = true } # Native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -egui-winit = { workspace = true, optional = true, default-features = false } puffin = { workspace = true, optional = true } winit = { workspace = true, optional = true, default-features = false, features = [ "rwh_06", # for compatibility with egui-winit diff --git a/crates/egui_glow/src/lib.rs b/crates/egui_glow/src/lib.rs index 8621dbd74e7..cfb95acd3d7 100644 --- a/crates/egui_glow/src/lib.rs +++ b/crates/egui_glow/src/lib.rs @@ -21,9 +21,9 @@ mod vao; pub use shader_version::ShaderVersion; -#[cfg(all(not(target_arch = "wasm32"), feature = "winit"))] +#[cfg(feature = "winit")] pub mod winit; -#[cfg(all(not(target_arch = "wasm32"), feature = "winit"))] +#[cfg(feature = "winit")] pub use winit::*; /// Check for OpenGL error and report it using `log::error`.