fix windows wasm embedded assets (#19139)
# Objective - Fix #14246 ## Solution - If building for wasm windows, add a bit of code that replaces `\\` with `/` in the `file!()` arg ## Testing - Used MRE https://github.com/janhohenheim/asset-crash --------- Co-authored-by: François Mockers <francois.mockers@vleue.com>
This commit is contained in:
parent
86cc02dca2
commit
ddc9f41519
@ -168,6 +168,13 @@ pub fn _embedded_asset_path(
|
||||
file_path: &Path,
|
||||
asset_path: &Path,
|
||||
) -> PathBuf {
|
||||
let file_path = if cfg!(not(target_family = "windows")) {
|
||||
// Work around bug: https://github.com/bevyengine/bevy/issues/14246
|
||||
// Note, this will break any paths on Linux/Mac containing "\"
|
||||
PathBuf::from(file_path.to_str().unwrap().replace("\\", "/"))
|
||||
} else {
|
||||
PathBuf::from(file_path)
|
||||
};
|
||||
let mut maybe_parent = file_path.parent();
|
||||
let after_src = loop {
|
||||
let Some(parent) = maybe_parent else {
|
||||
|
Loading…
Reference in New Issue
Block a user