mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
Make dynamic_linking a no-op on wasm targets (#12672)
# Objective Resolve #10054. ## Solution Make dynamic linking a no-op by omitting it from the dependency tree on wasm targets. To test this, try `cargo build --lib --target wasm32-unknown-unknown --features bevy/dynamic_linking` with and without this PR. Might need to update the book on the website to explain this when this makes it into a release. Co-Authored By: @daxpedda --------- Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
This commit is contained in:
parent
f1d1491126
commit
538d699994
2 changed files with 6 additions and 2 deletions
|
@ -330,9 +330,12 @@ meshlet_processor = ["bevy_internal/meshlet_processor"]
|
|||
ios_simulator = ["bevy_internal/ios_simulator"]
|
||||
|
||||
[dependencies]
|
||||
bevy_dylib = { path = "crates/bevy_dylib", version = "0.14.0-dev", default-features = false, optional = true }
|
||||
bevy_internal = { path = "crates/bevy_internal", version = "0.14.0-dev", default-features = false }
|
||||
|
||||
# WASM does not support dynamic linking.
|
||||
[target.'cfg(not(target_family = "wasm"))'.dependencies]
|
||||
bevy_dylib = { path = "crates/bevy_dylib", version = "0.14.0-dev", default-features = false, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.8.0"
|
||||
rand_chacha = "0.3.1"
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
|
||||
pub use bevy_internal::*;
|
||||
|
||||
#[cfg(feature = "dynamic_linking")]
|
||||
// WASM does not support dynamic linking.
|
||||
#[cfg(all(feature = "dynamic_linking", not(target_family = "wasm")))]
|
||||
#[allow(unused_imports)]
|
||||
use bevy_dylib;
|
||||
|
|
Loading…
Reference in a new issue