Skip to content

Commit

Permalink
[tutasdk] make the rust workspace work for the ios build
Browse files Browse the repository at this point in the history
  • Loading branch information
tuta-sudipg committed Jan 30, 2025
1 parent d96fe80 commit 1456042
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions tuta-sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target/
ios/tutasdk/generated-src/
*.xcodeproj
ios/lib
6 changes: 3 additions & 3 deletions tuta-sdk/ios/build-scripts/xc-universal-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ for arch in $ARCHS; do

# Intel iOS simulator
export CFLAGS_x86_64_apple_ios="-target x86_64-apple-ios"
cargo rustc --manifest-path="${SRC_ROOT}/Cargo.toml" -p "${FFI_TARGET}" --lib $RELFLAG --target x86_64-apple-ios -v
cargo rustc --manifest-path="${SRC_ROOT}/sdk/Cargo.toml" -p "${FFI_TARGET}" --lib $RELFLAG --target x86_64-apple-ios -v
;;

arm64)
if [ $IS_SIMULATOR -eq 0 ]; then
# Hardware iOS targets
cargo rustc --manifest-path="${SRC_ROOT}/Cargo.toml" -p "${FFI_TARGET}" --lib $RELFLAG --target aarch64-apple-ios -v
cargo rustc --manifest-path="${SRC_ROOT}/sdk/Cargo.toml" -p "${FFI_TARGET}" --lib $RELFLAG --target aarch64-apple-ios -v
else
# M1 iOS simulator
cargo rustc --manifest-path="${SRC_ROOT}/Cargo.toml" -p "${FFI_TARGET}" --lib $RELFLAG --target aarch64-apple-ios-sim -v
cargo rustc --manifest-path="${SRC_ROOT}/sdk/Cargo.toml" -p "${FFI_TARGET}" --lib $RELFLAG --target aarch64-apple-ios-sim -v
fi
esac
done
4 changes: 2 additions & 2 deletions tuta-sdk/rust/make_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ for target in "${TARGETS[@]}"; do
SWIFTC_SDK_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
esac

cargo build --lib --target "${target}" --release
cargo build --package tuta-sdk --lib --target "${target}" --release

# generate bindings for our target
cargo run --bin uniffi-bindgen generate --library "${RELEASE_DIR}/libtutasdk.dylib" --language swift --out-dir "${OUT_DIR}/"
cargo run --package uniffi-bindgen generate --library "${RELEASE_DIR}/libtutasdk.dylib" --language swift --out-dir "${OUT_DIR}/"

# generate swift module from dynamic library and bindings
# swiftc \
Expand Down

0 comments on commit 1456042

Please sign in to comment.