mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-18 00:23:14 +00:00
simplify conditional compilation and fix bug
This commit is contained in:
@@ -15,7 +15,6 @@ path = "src/main.rs"
|
||||
[[bin]]
|
||||
name = "studio-headless"
|
||||
path = "src/main-headless.rs"
|
||||
required-features = ["headless_cli"]
|
||||
|
||||
[dependencies]
|
||||
bevy-inspector-egui = "0.22.0"
|
||||
@@ -70,7 +69,6 @@ wasm = [
|
||||
"bevy_rapier3d/wasm-bindgen",
|
||||
]
|
||||
desktop = []
|
||||
headless_cli = []
|
||||
|
||||
[dependencies.bevy]
|
||||
workspace = true
|
||||
|
||||
@@ -91,11 +91,13 @@ impl AssetReader for RemoteAssetReader {
|
||||
let unboxed = async move {
|
||||
self.load(path).await
|
||||
};
|
||||
if cfg!(headless_cli) {
|
||||
if cfg!(not(feature = "wasm")) {
|
||||
info!("wasm mode not detected");
|
||||
// NB: Headless mode (server rendering) is running without a Tokio runtime.
|
||||
// The reqwest HTTP client requires async-compat to function at runtime.
|
||||
Box::pin(Compat::new(unboxed))
|
||||
} else {
|
||||
info!("wasm mode");
|
||||
Box::pin(unboxed)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user