Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
rustup target add aarch64-apple-ios-sim && \
rustup target add aarch64-apple-darwin && \
rustup target add x86_64-apple-darwin && \
rustup target add aarch64-apple-ios-macabi && \
rustup target add x86_64-apple-ios-macabi && \
cargo install --force --locked bindgen-cli

- name: Build all Apple targets and examples/tools
Expand Down
17 changes: 15 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ xcframework: apple-build
lipo -create -output swift/libs/idevice-ios-sim.a \
target/aarch64-apple-ios-sim/release/libidevice_ffi.a \
target/x86_64-apple-ios/release/libidevice_ffi.a
lipo -create -output swift/libs/idevice-maccatalyst.a \
target/aarch64-apple-ios-macabi/release/libidevice_ffi.a \
target/x86_64-apple-ios-macabi/release/libidevice_ffi.a
lipo -create -output swift/libs/idevice-macos.a \
target/aarch64-apple-darwin/release/libidevice_ffi.a \
target/x86_64-apple-darwin/release/libidevice_ffi.a
Expand All @@ -48,8 +51,9 @@ xcframework: apple-build
-library target/aarch64-apple-ios/release/libidevice_ffi.a -headers swift/include \
-library swift/libs/idevice-ios-sim.a -headers swift/include \
-library swift/libs/idevice-macos.a -headers swift/include \
-library swift/libs/idevice-maccatalyst.a -headers swift/include \
-output swift/IDevice.xcframework

zip -r swift/bundle.zip swift/IDevice.xcframework
openssl dgst -sha256 swift/bundle.zip

Expand All @@ -68,7 +72,16 @@ apple-build: # requires a Mac
BINDGEN_EXTRA_CLANG_ARGS="--sysroot=$(xcrun --sdk iphonesimulator --show-sdk-path)" \
cargo build --release --target x86_64-apple-ios

# Mac Catalyst (arm64)
# AWS-LC has an a hard time compiling for an iOS with macabi target, so we switch to ring.
BINDGEN_EXTRA_CLANG_ARGS="--sysroot=$(xcrun --sdk macosx --show-sdk-path)" \
cargo build --release --target aarch64-apple-ios-macabi --no-default-features --features "ring full"

# Mac Catalyst (x86_64)
# AWS-LC has an a hard time compiling for an iOS with macabi target, so we switch to ring.
BINDGEN_EXTRA_CLANG_ARGS="--sysroot=$(xcrun --sdk macosx --show-sdk-path)" \
cargo build --release --target x86_64-apple-ios-macabi --no-default-features --features "ring full"

# macOS (native) – no special env needed
cargo build --release --target aarch64-apple-darwin
cargo build --release --target x86_64-apple-darwin