From 24eccca8e6c9099f20cdef91828710f7093b6c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20F=C3=A9ron?= Date: Wed, 29 Mar 2023 14:59:45 +0200 Subject: [PATCH] Only enable instant/wasm-bindgen when building for wasm32 architecture (#2808) --- crates/egui-winit/Cargo.toml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index 90562389..f2214813 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -46,9 +46,6 @@ wayland = ["winit/wayland"] egui = { version = "0.21.0", path = "../egui", default-features = false, features = [ "tracing", ] } -instant = { version = "0.1", features = [ - "wasm-bindgen", -] } # We use instant so we can (maybe) compile for web tracing = { version = "0.1", default-features = false, features = ["std"] } winit = { version = "0.28", default-features = false } @@ -65,6 +62,14 @@ serde = { version = "1.0", optional = true, features = ["derive"] } webbrowser = { version = "0.8.3", optional = true } +[target.'cfg(not(target_arch="wasm32"))'.dependencies] +instant = { version = "0.1" } + +[target.'cfg(target_arch="wasm32")'.dependencies] +instant = { version = "0.1", features = [ + "wasm-bindgen", +] } # We use instant so we can (maybe) compile for web + [target.'cfg(any(target_os="linux", target_os="dragonfly", target_os="freebsd", target_os="netbsd", target_os="openbsd"))'.dependencies] smithay-clipboard = { version = "0.6.3", optional = true }