Skip to content
Closed
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
1 change: 1 addition & 0 deletions ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- autoreconf -i
- "cp ../../ios/autotools-ios-helper.sh ./autotools-ios-helper.sh"
- "./autotools-ios-helper.sh -iphoneuniversal"
- "./autotools-ios-helper.sh -maccatalyst"
:artifacts:
:includes:
- include/**
Expand Down
4 changes: 2 additions & 2 deletions ios/Lightway/Lightway.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
Expand Down Expand Up @@ -520,7 +520,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
Expand Down
14 changes: 12 additions & 2 deletions ios/Lightway/build-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,27 @@ xcodebuild archive \
-scheme Lightway \
-archivePath "./Build/ios.xcarchive" \
-sdk iphoneos \
SKIP_INSTALL=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO PLATFORM=universal
SKIP_INSTALL=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO \
SUPPORTS_MACCATALYST=NO

# iOS Sim
xcodebuild archive \
-scheme Lightway \
-archivePath "./Build/ios_sim.xcarchive" \
-sdk iphonesimulator \
SKIP_INSTALL=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO PLATFORM=universal
SKIP_INSTALL=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO \
SUPPORTS_MACCATALYST=NO

# Mac Catalyst
xcodebuild archive \
-scheme Lightway \
-archivePath "./Build/maccatalyst.xcarchive" \
-destination 'platform=macOS,variant=Mac Catalyst' \
SKIP_INSTALL=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

# Package XC Framework
xcodebuild -create-xcframework \
-framework "./Build/ios.xcarchive/Products/Library/Frameworks/Lightway.framework" \
-framework "./Build/ios_sim.xcarchive/Products/Library/Frameworks/Lightway.framework" \
-framework "./Build/maccatalyst.xcarchive/Products/Library/Frameworks/Lightway.framework" \
-output "./Build/Lightway.xcframework"
40 changes: 40 additions & 0 deletions ios/autotools-ios-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,43 @@ build_tvos_universal_binary() {
"${PREFIX}/${CONFIG}-appletvos/lib/${LIB_NAME}" \
"${PREFIX}/${CONFIG}-appletvsimulator/lib/${LIB_NAME}"
}

build_maccatalyst_arm64() {
export SDK="macosx"
export PLATFORM="maccatalyst-arm64"
export EFFECTIVE_PLATFORM_NAME="-maccatalyst-arm64"
export ARCH_OPTS="--enable-armasm --enable-sp-asm"
export ARCH_FLAGS="-arch arm64"
export HOST_FLAGS="${ARCH_FLAGS} -target arm64-apple-ios13.1-macabi -isysroot $(xcrun --sdk ${SDK} --show-sdk-path) -iframework $(xcrun --sdk ${SDK} --show-sdk-path)/System/iOSSupport/System/Library/Frameworks"
export CHOST="arm64-apple-darwin"
build
}

build_maccatalyst_x86_64() {
export SDK="macosx"
export PLATFORM="maccatalyst-x86_64"
export EFFECTIVE_PLATFORM_NAME="-maccatalyst-x86_64"
export ARCH_OPTS=""
export ARCH_FLAGS="-arch x86_64"
export HOST_FLAGS="${ARCH_FLAGS} -target x86_64-apple-ios13.1-macabi -isysroot $(xcrun --sdk ${SDK} --show-sdk-path) -iframework $(xcrun --sdk ${SDK} --show-sdk-path)/System/iOSSupport/System/Library/Frameworks"
export CHOST="x86_64-apple-darwin"
build
}

build_maccatalyst_universal_binary() {
# Create catalyst universal binary
LIB_NAME="libwolfssl.a"
mkdir -p "${PREFIX}/${CONFIG}-maccatalyst/lib"
lipo -create -output "${PREFIX}/${CONFIG}-maccatalyst/lib/${LIB_NAME}" \
"${PREFIX}/${CONFIG}-maccatalyst-arm64/lib/${LIB_NAME}" \
"${PREFIX}/${CONFIG}-maccatalyst-x86_64/lib/${LIB_NAME}"
}

build_maccatalyst() {
build_maccatalyst_arm64
build_maccatalyst_x86_64
build_maccatalyst_universal_binary
}
# Locations
PREFIX=${PREFIX:-"$(pwd)/../builds/wolfssl_ios"}
CONFIG=${CONFIG:-"Release"}
Expand Down Expand Up @@ -169,6 +206,9 @@ case "${TARGET}" in
build_tvsimulator
build_tvos_universal_binary
;;
-maccatalyst)
build_maccatalyst
;;
-all)
build_iphoneos
build_iphonesimulator
Expand Down
Loading