Skip to content

Commit caabf96

Browse files
committed
ffi: add visionOS support to Swift package
Closes #264 Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 8182363 commit caabf96

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

bindings/nostr-sdk-ffi/swift/Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ let package = Package(
88
platforms: [
99
.macOS(.v12),
1010
.iOS(.v14),
11+
.visionOS(.v1),
1112
],
1213
products: [
1314
.library(name: "NostrSDK", targets: ["nostr_sdkFFI", "NostrSDK"]),

bindings/nostr-sdk-ffi/swift/build-xcframework.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ rm -rf "${SOURCES_DIR}" # Remove old Sources dir
2323
rm -rf "${XCFRAMEWORK_DIR}" # Remove old <NAME>.xcframework dir
2424

2525
# Install targets
26-
rustup target add aarch64-apple-ios # iOS arm64
27-
rustup target add x86_64-apple-ios # iOS x86_64
28-
rustup target add aarch64-apple-ios-sim # simulator mac M1
29-
rustup target add aarch64-apple-darwin # mac M1
30-
rustup target add x86_64-apple-darwin # mac x86_64
31-
rustup target add aarch64-apple-ios-macabi # mac catalyst arm64
32-
rustup target add x86_64-apple-ios-macabi # mac catalyst x86_64
26+
rustup target add aarch64-apple-ios # iOS arm64
27+
rustup target add x86_64-apple-ios # iOS x86_64
28+
rustup target add aarch64-apple-ios-sim # simulator mac M1
29+
rustup target add aarch64-apple-darwin # mac M1
30+
rustup target add x86_64-apple-darwin # mac x86_64
31+
rustup target add aarch64-apple-ios-macabi # mac catalyst arm64
32+
rustup target add x86_64-apple-ios-macabi # mac catalyst x86_64
33+
rustup target add aarch64-apple-visionos # visionOS arm64
34+
rustup target add aarch64-apple-visionos-sim # visionOS simulator
3335

3436
# Build iOS and Darwin targets
3537
cargo build -p nostr-sdk-ffi --lib --release --target x86_64-apple-darwin
@@ -39,6 +41,8 @@ cargo build -p nostr-sdk-ffi --lib --release --target aarch64-apple-ios
3941
cargo build -p nostr-sdk-ffi --lib --release --target aarch64-apple-ios-sim
4042
cargo build -p nostr-sdk-ffi --lib --release --target aarch64-apple-ios-macabi
4143
cargo build -p nostr-sdk-ffi --lib --release --target x86_64-apple-ios-macabi
44+
cargo build -p nostr-sdk-ffi --lib --release --target aarch64-apple-visionos
45+
cargo build -p nostr-sdk-ffi --lib --release --target aarch64-apple-visionos-sim
4246

4347
# Make universal dirs
4448
mkdir -p "${TARGET_DIR}/ios-universal-sim/release" # iOS Simulator
@@ -91,6 +95,10 @@ xcodebuild -create-xcframework \
9195
-headers "${FFI_HEADERS_DIR}" \
9296
-library "${TARGET_DIR}/maccatalyst-universal/release/${STATIC_LIB}" \
9397
-headers "${FFI_HEADERS_DIR}" \
98+
-library "${TARGET_DIR}/aarch64-apple-visionos/release/${STATIC_LIB}" \
99+
-headers "${FFI_HEADERS_DIR}" \
100+
-library "${TARGET_DIR}/aarch64-apple-visionos-sim/release/${STATIC_LIB}" \
101+
-headers "${FFI_HEADERS_DIR}" \
94102
-output "${XCFRAMEWORK_DIR}"
95103

96104
echo "Done!"

0 commit comments

Comments
 (0)