From 07c6e0de0fdb2ee76e0c2ec546a1e8e6833e4b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20G=C3=B6rtler?= Date: Tue, 19 May 2026 18:00:50 +0200 Subject: [PATCH] Exclude `take_app` from `wasm32` in `egui_kittest` (#8178) Otherwise `egui` won't compile for `wasm32` targets anymore. A bit odd that this was not caught in CI. --- crates/egui_kittest/src/app_kind.rs | 1 + crates/egui_kittest/src/builder.rs | 1 + crates/egui_kittest/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/egui_kittest/src/app_kind.rs b/crates/egui_kittest/src/app_kind.rs index 42edd6d66..942ec4b85 100644 --- a/crates/egui_kittest/src/app_kind.rs +++ b/crates/egui_kittest/src/app_kind.rs @@ -10,6 +10,7 @@ type AppKindUi<'a> = Box; #[cfg(feature = "eframe")] pub(crate) struct AppKindEframe { pub get_app: fn(&mut State) -> &mut dyn eframe::App, + #[cfg(not(target_arch = "wasm32"))] pub take_app: fn(State) -> Box, pub frame: eframe::Frame, } diff --git a/crates/egui_kittest/src/builder.rs b/crates/egui_kittest/src/builder.rs index 58bfb8601..dc4757ee5 100644 --- a/crates/egui_kittest/src/builder.rs +++ b/crates/egui_kittest/src/builder.rs @@ -211,6 +211,7 @@ impl HarnessBuilder { let kind = AppKind::Eframe(AppKindEframe { get_app: |state| state, + #[cfg(not(target_arch = "wasm32"))] take_app: |state| Box::new(state), frame, }); diff --git a/crates/egui_kittest/src/lib.rs b/crates/egui_kittest/src/lib.rs index 4fa68d93c..2b7c4f8f3 100644 --- a/crates/egui_kittest/src/lib.rs +++ b/crates/egui_kittest/src/lib.rs @@ -711,7 +711,7 @@ impl<'a, State> Harness<'a, State> { /// Then write a `fn main()` in the test file that invokes your test directly. /// /// See also: - #[cfg(feature = "eframe")] + #[cfg(all(feature = "eframe", not(target_arch = "wasm32")))] #[deprecated = "Only for debugging, don't commit this."] pub fn spawn_eframe_app(self) where