Skip to content

Commit

Permalink
fix ios build script
Browse files Browse the repository at this point in the history
  • Loading branch information
lukejmann committed Feb 1, 2024
1 parent 5a852cc commit ddef898
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions build_ios.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
rm -rf ios_build
rm -rf WalletKit.xcframework
mkdir ios_build
mkdir ios_build/bindings
mkdir -p ios_build/target/universal-ios-sim/release
mkdir -p ./Sources/Oxide


export IPHONEOS_DEPLOYMENT_TARGET="13.0"
export RUSTFLAGS="-C link-arg=-Wl,-application_extension"
cargo build --package walletkit --target aarch64-apple-ios-sim --release
cargo build --package walletkit --target aarch64-apple-ios --release
cargo build --package walletkit --target x86_64-apple-ios --release


lipo -create target/aarch64-apple-ios-sim/release/libwalletkit.a \
target/x86_64-apple-ios/release/libwalletkit.a \
-output ./ios_build/target/universal-ios-sim/release/libwalletkit.a

cargo run -p uniffi-bindgen generate \
target/aarch64-apple-ios-sim/release/libwalletkit.dylib \
--library \
--language swift \
--no-format \
--out-dir ios_build/bindings

mv ./ios_build/bindings/walletkit.swift ./Sources/Oxide/

mkdir ios_build/Headers
mv ./ios_build/bindings/walletkitFFI.h ./ios_build/Headers/

cat ./ios_build/bindings/walletkitFFI.modulemap > ./ios_build/Headers/module.modulemap

xcodebuild -create-xcframework \
-library target/aarch64-apple-ios/release/libwalletkit.a \
-headers ./ios_build/Headers \
-library ./ios_build/target/universal-ios-sim/release/libwalletkit.a \
-headers ./ios_build/Headers \
-output ./WalletKit.xcframework

rm -rf ios_build

0 comments on commit ddef898

Please sign in to comment.