Cargo.toml: reduce dependencies of CLI, WASM

This commit is contained in:
Alain Emilia Anna Zscheile 2024-09-30 18:53:12 +02:00
parent 507ca01bfc
commit 1ec85552bb
2 changed files with 19 additions and 7 deletions

View File

@ -19,7 +19,16 @@ required-features = ["egui"]
[features]
default = ["disable_contracts"]
cli = ["dep:clap"]
egui = ["dep:sys-locale", "dep:unic-langid", "dep:fluent-templates", "dep:eframe", "dep:egui", "dep:rfd", "dep:futures-executor"]
egui = [
"dep:eframe",
"dep:egui",
"dep:env_logger",
"dep:fluent-templates",
"dep:futures-lite",
"dep:rfd",
"dep:sys-locale",
"dep:unic-langid"
]
disable_contracts = ["contracts/disable_contracts"]
[dependencies]
@ -77,12 +86,15 @@ version = "0.28.1"
optional = true
version = "0.14.0"
[dependencies.futures-executor]
optional = true
version = "0.3.30"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
env_logger = "0.10"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.futures-lite]
optional = true
version = "2.3"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.env_logger]
optional = true
version = "0.11"
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"

View File

@ -223,7 +223,7 @@ impl eframe::App for App {
#[cfg(not(target_arch = "wasm32"))]
pub fn execute<F: Future<Output = ()> + Send + 'static>(f: F) {
std::thread::spawn(move || futures_executor::block_on(f));
std::thread::spawn(move || futures_lite::future::block_on(f));
}
#[cfg(target_arch = "wasm32")]