Skip to content

Commit

Permalink
SDK build improvements for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
afilini committed Oct 23, 2024
1 parent 66493ad commit 3cfb0ae
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 33 deletions.
21 changes: 15 additions & 6 deletions sdk/libportal-ios/build-local-swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ lipo ../target/aarch64-apple-ios-sim/release/libportal.a ../target/x86_64-apple-

popd

rm -rf ./portalFFI.xcframework
rm -rf ../../target/include

mkdir -pv ../../target/include
cp Sources/LibPortal/portalFFI.h ../../target/include/
cp Sources/LibPortal/portalFFI.modulemap ../../target/include/module.modulemap

# create new xcframework directory from bdk-ffi static libs and headers
xcodebuild -create-xcframework \
-library "../../target/aarch64-apple-ios/release/libportal.a" \
-headers "../../target/include" \
-library "../../target/lipo-ios-sim/release/libportal.a" \
-headers "../../target/include" \
-output "./portalFFI.xcframework"

mv Sources/LibPortal/portal.swift Sources/LibPortal/LibPortal.swift
cp Sources/LibPortal/portalFFI.h portalFFI.xcframework/ios-arm64/portalFFI.framework/Headers
cp Sources/LibPortal/portalFFI.h portalFFI.xcframework/ios-arm64_x86_64-simulator/portalFFI.framework/Headers
cp ../../target/aarch64-apple-ios/release/libportal.a portalFFI.xcframework/ios-arm64/portalFFI.framework/portalFFI
cp ../../target/lipo-ios-sim/release/libportal.a portalFFI.xcframework/ios-arm64_x86_64-simulator/portalFFI.framework/portalFFI
rm Sources/LibPortal/portalFFI.h
rm Sources/LibPortal/portalFFI.modulemap

PACKAGE=${PACKAGE-'0'}
if [ "$PACKAGE" -eq '1' ]; then
Expand Down
22 changes: 15 additions & 7 deletions sdk/libportal-ios/portalFFI.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,39 @@
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>libportal.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>portalFFI.framework</string>
<string>libportal.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libportal.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>portalFFI.framework</string>
<string>libportal.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 3cfb0ae

Please sign in to comment.