Skip to content

Commit

Permalink
Do not use "bevy/dynamic_linking" or "bevy/file_watcher" on wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
maaku committed Dec 8, 2023
1 parent f7065d6 commit 8b7cc4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ codegen-units = 1
inherits = "release"
lto = "thin"

[features]
dev = [
"bevy/dynamic_linking",
"bevy/file_watcher",
]

[dependencies]
bevy = { workspace = true }
bevy_asset_loader = { version = "0.18" }
Expand Down
8 changes: 8 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ fn main() {
// on windows we will set our app icon as icon for the executable
embed_resource::compile("build/windows/icon.rc");
}
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let profile = env::var("PROFILE").unwrap();
if !target_arch.contains("wasm") && profile.contains("debug") {
// Use dynamic linking for faster recompilation
println!("cargo:rustc-cfg=feature=\"bevy/dynamic_linking\"");
// Enable bevy's asset hot-reloading capability
println!("cargo:rustc-cfg=feature=\"bevy/file_watcher\"");
}
}

// End of File

0 comments on commit 8b7cc4a

Please sign in to comment.