conditional compilation of async compat (#95)

Problems with the previous code:

- `async-compat` is necessary for headless mode (cli server rendering)
to load remote scenes from the API without blowing up. Without it, the
code complains about the lack of a Tokio runtime.

- Unfortunately, `async-compat` doesn't work with WASM and the entire
web build is broken by its presence.

This change introduces conditional compilation so `async-compat` is only
leveraged in headless mode.
This commit is contained in:
Brandon Thomas
2024-03-20 22:36:28 -04:00
committed by GitHub
parent 89487e5889
commit ba97339b1b
2 changed files with 77 additions and 61 deletions
+2
View File
@@ -15,6 +15,7 @@ path = "src/main.rs"
[[bin]]
name = "studio-headless"
path = "src/main-headless.rs"
required-features = ["headless_cli"]
[dependencies]
bevy-inspector-egui = "0.22.0"
@@ -69,6 +70,7 @@ wasm = [
"bevy_rapier3d/wasm-bindgen",
]
desktop = []
headless_cli = []
[dependencies.bevy]
workspace = true