Skip to content
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,30 @@ jobs:
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf automake libtool
- name: Run build
run: ceedling project:tvos verbosity[4] release
catalyst:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Install Ceedling
run: sudo gem install ceedling -v 0.31.1 --no-user-install
- name: Install automake
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf automake libtool
- name: Build arm64
run: CATALYST_TARGET_TRIPLE=arm64-apple-ios13.1-macabi ceedling project:catalyst verbosity[4] release
- name: Save arm64 build
run: cp build/artifacts/release/libhelium.a libhelium_arm64.a
- name: Clean build
run: ceedling project:catalyst clobber
- name: Build x86_64
run: CATALYST_TARGET_TRIPLE=x86_64-apple-ios13.1-macabi ceedling project:catalyst verbosity[4] release
- name: Save x86_64 build
run: cp build/artifacts/release/libhelium.a libhelium_x86_64.a
- name: Create universal binary
run: lipo -create libhelium_arm64.a libhelium_x86_64.a -output build/artifacts/release/libhelium.a
android:
runs-on: ubuntu-22.04
strategy:
Expand Down
36 changes: 36 additions & 0 deletions catalyst.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
:import:
- 3rd_party_deps.yml
- unix.yml

:release_build:
:output: libhelium.a

:dependencies:
:libraries:
- :name: WolfSSL
:source_path: third_party/wolfssl
:artifact_path: third_party/builds/wolfssl_catalyst
:fetch:
:method: :git
:source: $HE_WOLFSSL_SOURCE
:tag: $HE_WOLFSSL_TAG
:build:
- git apply ../../wolfssl/*.patch
- autoreconf -i
- cp ../../ios/autotools-ios-helper.sh ./autotools-ios-helper.sh
- PREFIX=$(pwd)/../builds/wolfssl_catalyst ./autotools-ios-helper.sh -maccatalyst
:artifacts:
:includes:
- include/**
:static_libraries:
- Release-maccatalyst/lib/libwolfssl.a

:flags:
:release:
:compile:
:*:
- -target
- $CATALYST_TARGET_TRIPLE

:environment:
- MACOSX_DEPLOYMENT_TARGET: "13.1"
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