From f9e70abcacf614d3ed175255579dc669421ac723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Wed, 6 Mar 2024 18:48:17 +0100 Subject: [PATCH] Fix ios simulator support (#12339) # Objective - #12103 broke iOS simulator support, it doesn't even compile anymore ## Solution - Fix the feature --- Cargo.toml | 3 +++ crates/bevy_internal/Cargo.toml | 3 +++ docs/cargo_features.md | 1 + examples/mobile/.cargo/config.toml | 5 ----- examples/mobile/Cargo.toml | 3 +++ 5 files changed, 10 insertions(+), 5 deletions(-) delete mode 100644 examples/mobile/.cargo/config.toml diff --git a/Cargo.toml b/Cargo.toml index 446d4a13d1c62..d95f1b6d7f84b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -318,6 +318,9 @@ embedded_watcher = ["bevy_internal/embedded_watcher"] # Enable stepping-based debugging of Bevy systems bevy_debug_stepping = ["bevy_internal/bevy_debug_stepping"] +# Enable support for the ios_simulator by downgrading some rendering capabilities +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 } diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index 9396eca5d4e20..da98324894453 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -163,6 +163,9 @@ bevy_debug_stepping = [ "bevy_app/bevy_debug_stepping", ] +# Enable support for the ios_simulator by downgrading some rendering capabilities +ios_simulator = ["bevy_pbr?/ios_simulator", "bevy_render?/ios_simulator"] + [dependencies] # bevy bevy_a11y = { path = "../bevy_a11y", version = "0.14.0-dev" } diff --git a/docs/cargo_features.md b/docs/cargo_features.md index fa3f20d0ad191..e82d98adf8a77 100644 --- a/docs/cargo_features.md +++ b/docs/cargo_features.md @@ -61,6 +61,7 @@ The default feature set enables most of the expected features of a game engine, |file_watcher|Enables watching the filesystem for Bevy Asset hot-reloading| |flac|FLAC audio format support| |glam_assert|Enable assertions to check the validity of parameters passed to glam| +|ios_simulator|Enable support for the ios_simulator by downgrading some rendering capabilities| |jpeg|JPEG image format support| |minimp3|MP3 audio format support (through minimp3)| |mp3|MP3 audio format support| diff --git a/examples/mobile/.cargo/config.toml b/examples/mobile/.cargo/config.toml deleted file mode 100644 index 27767cc6e1561..0000000000000 --- a/examples/mobile/.cargo/config.toml +++ /dev/null @@ -1,5 +0,0 @@ -# Flag to notify the compiler we're building for the iOS simulator from an Apple silicon mac -# This needs some workarounds for now -# See https://github.com/bevyengine/bevy/pull/10178 - remove if it's not needed anymore. -[target.aarch64-apple-ios-sim] -features = ["bevy_render/ios_simulator"] diff --git a/examples/mobile/Cargo.toml b/examples/mobile/Cargo.toml index 194970d0728c9..e1e768a2fcc75 100644 --- a/examples/mobile/Cargo.toml +++ b/examples/mobile/Cargo.toml @@ -13,6 +13,9 @@ crate-type = ["staticlib", "cdylib"] [dependencies] bevy = { path = "../../" } +[target.aarch64-apple-ios-sim.dependencies] +bevy = { path = "../../", features = ["ios_simulator"] } + [package.metadata.android] package = "org.bevyengine.example" apk_name = "bevyexample"