diff --git a/examples/ios/Cargo.toml b/examples/ios/Cargo.toml index 6f9c3e5bdb..4f8796a1b7 100644 --- a/examples/ios/Cargo.toml +++ b/examples/ios/Cargo.toml @@ -15,14 +15,10 @@ bevy = { path = "../../", features = [ "bevy_audio", "bevy_core_pipeline", "bevy_gltf2", - "bevy_wgpu", "bevy_sprite2", "bevy_render2", "bevy_pbr2", "bevy_winit", - "render", - "png", - "hdr", "mp3", "x11", "filesystem_watcher" diff --git a/examples/ios/build_rust_deps.sh b/examples/ios/build_rust_deps.sh index ec39adf372..7714d6c6f8 100755 --- a/examples/ios/build_rust_deps.sh +++ b/examples/ios/build_rust_deps.sh @@ -13,11 +13,12 @@ fi set -euvx -# add path to the system SDK, needed since macOS 11 -if [ -z ${LIBRARY_PATH+x} ]; then - export LIBRARY_PATH="$(xcrun --show-sdk-path)/usr/lib" -else - export LIBRARY_PATH="$LIBRARY_PATH:$(xcrun --show-sdk-path)/usr/lib" +if [[ -n "${DEVELOPER_SDK_DIR:-}" ]]; then + # Assume we're in Xcode, which means we're probably cross-compiling. + # In this case, we need to add an extra library search path for build scripts and proc-macros, + # which run on the host instead of the target. + # (macOS Big Sur does not have linkable libraries in /usr/lib/.) + export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH:-}" fi # add homebrew bin path, as it's the most commonly used package manager on macOS