@@ -9,42 +9,27 @@ license = "MIT OR Apache-2.0"
99keywords = [" bevy" ]
1010
1111[features ]
12- default = [" std " , " async_executor " ]
12+ default = [" async_executor " , " futures-lite " ]
1313
14- # Functionality
15-
16- # # Enables multi-threading support.
17- # # Without this feature, all tasks will be run on a single thread.
14+ # Enables multi-threading support.
15+ # Without this feature, all tasks will be run on a single thread.
1816multi_threaded = [
19- " std" ,
17+ " bevy_platform/ std" ,
2018 " dep:async-channel" ,
2119 " dep:concurrent-queue" ,
2220 " async_executor" ,
2321]
2422
25- # # Uses `async-executor` as a task execution backend.
26- # # This backend is incompatible with `no_std` targets.
27- async_executor = [" std" , " dep:async-executor" ]
28-
29- # Platform Compatibility
23+ # Uses `async-executor` as a task execution backend.
24+ # This backend is incompatible with `no_std` targets.
25+ async_executor = [" bevy_platform/std" , " dep:async-executor" ]
3026
31- # # Allows access to the `std` crate. Enabling this feature will prevent compilation
32- # # on `no_std` targets, but provides access to certain additional features on
33- # # supported platforms.
34- std = [" futures-lite/std" , " async-task/std" , " bevy_platform/std" ]
27+ # Provide an implementation of `block_on` from `futures-lite`.
28+ futures-lite = [" bevy_platform/std" , " futures-lite/std" ]
3529
36- # # `critical-section` provides the building blocks for synchronization primitives
37- # # on all platforms, including `no_std`.
38- critical-section = [" bevy_platform/critical-section" ]
39-
40- # # Enables use of browser APIs.
41- # # Note this is currently only applicable on `wasm32` architectures.
42- web = [
43- " bevy_platform/web" ,
44- " dep:wasm-bindgen-futures" ,
45- " dep:pin-project" ,
46- " dep:futures-channel" ,
47- ]
30+ # Use async-io's implementation of block_on instead of futures-lite's implementation.
31+ # This is preferred if your application uses async-io.
32+ async-io = [" bevy_platform/std" , " dep:async-io" ]
4833
4934[dependencies ]
5035bevy_platform = { path = " ../bevy_platform" , version = " 0.17.0-dev" , default-features = false , features = [
@@ -59,7 +44,6 @@ derive_more = { version = "2", default-features = false, features = [
5944 " deref" ,
6045 " deref_mut" ,
6146] }
62- cfg-if = " 1.0.0"
6347async-executor = { version = " 1.11" , optional = true }
6448async-channel = { version = " 2.3.0" , optional = true }
6549async-io = { version = " 2.0.0" , optional = true }
@@ -70,9 +54,8 @@ crossbeam-queue = { version = "0.3", default-features = false, features = [
7054] }
7155
7256[target .'cfg(target_arch = "wasm32")' .dependencies ]
73- wasm-bindgen-futures = { version = " 0.4" , optional = true }
74- pin-project = { version = " 1" , optional = true }
75- futures-channel = { version = " 0.3" , optional = true }
57+ pin-project = { version = " 1" }
58+ futures-channel = { version = " 0.3" , default-features = false }
7659
7760[target .'cfg(not(all(target_has_atomic = "8", target_has_atomic = "16", target_has_atomic = "32", target_has_atomic = "64", target_has_atomic = "ptr")))' .dependencies ]
7861async-task = { version = " 4.4.0" , default-features = false , features = [
@@ -85,6 +68,11 @@ atomic-waker = { version = "1", default-features = false, features = [
8568 " portable-atomic" ,
8669] }
8770
71+ [dev-dependencies ]
72+ futures-lite = { version = " 2.0.1" , default-features = false , features = [
73+ " std" ,
74+ ] }
75+
8876[lints ]
8977workspace = true
9078
0 commit comments