Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 9 additions & 24 deletions .github/workflows/coreaudio-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,37 +50,22 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

ios-build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Add iOS targets
run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim
- name: Build iphonesimulator feedback example
run: cd examples/apple && xcodebuild ONLY_ACTIVE_ARCH=NO ARCHS=arm64 -scheme coreaudio-ios-example -configuration Debug -derivedDataPath build -sdk iphonesimulator

tvos-build:
xcode-builds:
runs-on: macOS-latest
env:
ONLY_ACTIVE_ARCH: NO
ARCHS: arm64
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src
- name: Build for tvOS simulator
run: cd examples/apple && cargo +nightly build -Zbuild-std --target aarch64-apple-tvos-sim --release
- name: Build for tvOS device
run: cd examples/apple && cargo +nightly build -Zbuild-std --target aarch64-apple-tvos --release
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Add iOS targets
run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim
- name: Build appletvsimulator example
run: cd examples/apple && xcodebuild ONLY_ACTIVE_ARCH=NO ARCHS=arm64 -scheme coreaudio-tvos-example -configuration Debug -derivedDataPath build -sdk appletvsimulator
targets: "aarch64-apple-ios,aarch64-apple-ios-sim"
- run: cd examples/apple
- run: xcodebuild -scheme coreaudio-tvos-example -configuration Debug -derivedDataPath build -sdk appletvsimulator
- run: xcodebuild -scheme coreaudio-ios-example -configuration Debug -derivedDataPath build -sdk iphonesimulator
- run: xcodebuild -scheme coreaudio-visionos-example -configuration Debug -derivedDataPath build -sdk xrsimulator

# Build the docs with all features to make sure docs.rs will work.
macos-docs:
Expand Down
47 changes: 31 additions & 16 deletions examples/apple/build_rust_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,34 @@ if [[ -n "${DEVELOPER_SDK_DIR:-}" ]]; then
export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH:-}"
fi

# Detect which platform we're building for based on SDKROOT
# SDKROOT is set by Xcode and contains the SDK path (e.g., iphoneos, iphonesimulator, appletvos, appletvsimulator)
case "${SDKROOT:-}" in
*appletvos*|*appletvsimulator*)
# Build for tvOS (requires nightly toolchain and -Zbuild-std since tvOS is a Tier 3 target)
cargo +nightly build -Zbuild-std --target aarch64-apple-tvos-sim --release
cargo +nightly build -Zbuild-std --target aarch64-apple-tvos --release
;;
*)
# Default: Build for iOS (stable toolchain)
# Device (arm64)
cargo build --target aarch64-apple-ios --release
# Simulator (arm64)
cargo build --target aarch64-apple-ios-sim --release
;;
esac
TARGET_DEVICE_PLATFORM_NAME=xrsimulator
echo $TARGET_DEVICE_PLATFORM_NAME
echo SDK ROOT IS: $SDKROOT
cargo +nightly build -Zbuild-std \
--target aarch64-apple-tvos-sim \
--target aarch64-apple-tvos \
--target aarch64-apple-visionos \
--target aarch64-apple-visionos-sim \
--release

cargo build --target aarch64-apple-ios --target aarch64-apple-ios-sim --release

## Detect which platform we're building for based on SDKROOT
## SDKROOT is set by Xcode and contains the SDK path (e.g., iphoneos, iphonesimulator, appletvos, appletvsimulator)
#case "${TARGET_DEVICE_PLATFORM_NAME:-}" in
# *Appletvos*|*AppleTVSimulator*)
# # Build for tvOS (requires nightly toolchain and -Zbuild-std since tvOS is a Tier 3 target)
# cargo +nightly build -Zbuild-std --target aarch64-apple-tvos-sim --target aarch64-apple-tvos --release
# ;;
# *XROs*|*XRSimulator*|*xrsimulator*|*rxos*)
# # Build for tvOS (requires nightly toolchain and -Zbuild-std since tvOS is a Tier 3 target)
# cargo +nightly build -Zbuild-std --target aarch64-apple-visionos-sim --target aarch64-apple-visionos --release
# ;;
# *)
# # Default: Build for iOS (stable toolchain)
# # Device (arm64)
# cargo build --target aarch64-apple-ios --release
# # Simulator (arm64)
# cargo build --target aarch64-apple-ios-sim --release
# ;;
#esac
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bleh. I failed at figuring out how to get xcodebuild and the xcode GUI build button to work as expected when switching between targets and schemes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided that having a rust-toolchain.toml in the examples/apple directory is an okay compromise. I do not love it but fighting xcode is not fun.

Loading
Loading