Skip to content

Commit

Permalink
chore: Add support for more iOS architectures.
Browse files Browse the repository at this point in the history
Including simulator (i386 and x86_64).
  • Loading branch information
iphydf committed Jan 27, 2025
1 parent 13ad8e8 commit aa0e2a8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
path: prefix
key: ${{ github.job }}-${{ matrix.arch }}-deps
- name: Run build
run: other/deploy/linux.sh
run: other/deploy/linux.sh "${{ matrix.arch }}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
path: prefix
key: ${{ github.job }}-${{ matrix.arch }}-deps
- name: Run build
run: other/deploy/macos.sh
run: other/deploy/macos.sh "${{ matrix.arch }}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
needs: [update-nightly-tag]
strategy:
matrix:
arch: [arm64]
arch: [arm64, armv7, armv7s, i386, x86_64]
runs-on: 'macos-14'
steps:
- uses: actions/checkout@v4
Expand All @@ -178,7 +178,7 @@ jobs:
path: prefix
key: ${{ github.job }}-${{ matrix.arch }}-deps
- name: Run build
run: other/deploy/ios.sh
run: other/deploy/ios.sh "${{ matrix.arch }}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion other/deploy/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
git clone --depth=1 https://github.com/TokTok/dockerfiles "$SCRIPT_DIR/dockerfiles"

SYSTEM="$1"
ARCH="$(uname -m)"
ARCH="$2"

DEP_PREFIX="$PWD/prefix"

Expand Down
16 changes: 12 additions & 4 deletions other/deploy/ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@ set -eux -o pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

"$SCRIPT_DIR/deps.sh" ios
ARCH="$1"
"$SCRIPT_DIR/deps.sh" ios "$ARCH"

export PKG_CONFIG_PATH="$PWD/prefix/lib/pkgconfig"

IOS_FLAGS="-miphoneos-version-min=10.0 -arch arm64"
IOS_FLAGS="-miphoneos-version-min=10.0 -arch $ARCH"

if [ "$ARCH" = "i386" ] || [ "$ARCH" = "x86_64" ]; then
XC_SDK="iphonesimulator"
else
XC_SDK="iphoneos"
fi

# Build for iOS 10
cmake \
-B _build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX="$PWD/toxcore-ios-$(uname -m)" \
-DCMAKE_INSTALL_PREFIX="$PWD/toxcore-ios-$ARCH" \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_STATIC=OFF \
-DENABLE_SHARED=ON \
Expand All @@ -28,7 +35,8 @@ cmake \
-DCMAKE_CXX_FLAGS="$IOS_FLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="$IOS_FLAGS" \
-DCMAKE_SHARED_LINKER_FLAGS="$IOS_FLAGS" \
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk iphoneos --show-sdk-path)"
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk "$XC_SDK" --show-sdk-path)" \
-DCMAKE_OSX_ARCHITECTURES="$ARCH"

cmake --build _build
cmake --install _build
5 changes: 3 additions & 2 deletions other/deploy/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ set -eux -o pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

"$SCRIPT_DIR/deps.sh" linux
ARCH="$1"
"$SCRIPT_DIR/deps.sh" linux "$ARCH"

export PKG_CONFIG_PATH="$PWD/prefix/lib/pkgconfig"

# Build
cmake \
-B _build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX="$PWD/toxcore-linux-$(uname -m)" \
-DCMAKE_INSTALL_PREFIX="$PWD/toxcore-linux-$ARCH" \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_STATIC=OFF \
-DENABLE_SHARED=ON \
Expand Down
5 changes: 3 additions & 2 deletions other/deploy/macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ set -eux -o pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

"$SCRIPT_DIR/deps.sh" macos
ARCH="$1"
"$SCRIPT_DIR/deps.sh" macos "$ARCH"

export PKG_CONFIG_PATH="$PWD/prefix/lib/pkgconfig"

# Build for macOS
cmake \
-B _build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX="$PWD/toxcore-macos-$(uname -m)" \
-DCMAKE_INSTALL_PREFIX="$PWD/toxcore-macos-$ARCH" \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_STATIC=OFF \
-DENABLE_SHARED=ON \
Expand Down

0 comments on commit aa0e2a8

Please sign in to comment.