From e929ee7bf8e9acdf5e0857069919f7640a2a6966 Mon Sep 17 00:00:00 2001 From: Gonzalo Exequiel Pedone Date: Sun, 30 Apr 2023 18:26:20 -0300 Subject: [PATCH] Build for ARM64 in Mac. --- .github/workflows/mac.yml | 13 +++++++++++++ ports/ci/mac/build.sh | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index bf96aa8..b7aba10 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -13,14 +13,27 @@ jobs: matrix: include: - os: macos-13 + architecture: x64 upload: 0 - os: macos-12 + architecture: x64 upload: 0 - os: macos-11 + architecture: x64 + upload: 1 + - os: macos-13 + architecture: arm64 + upload: 0 + - os: macos-12 + architecture: arm64 + upload: 0 + - os: macos-11 + architecture: arm64 upload: 1 runs-on: ${{ matrix.os }} env: UPLOAD: ${{ matrix.upload }} + ARCHITECTURE: ${{ matrix.architecture }} steps: - uses: actions/checkout@v2 - name: Install dependencies diff --git a/ports/ci/mac/build.sh b/ports/ci/mac/build.sh index 3e01af8..079c842 100644 --- a/ports/ci/mac/build.sh +++ b/ports/ci/mac/build.sh @@ -25,6 +25,12 @@ if [ -z "${DISABLE_CCACHE}" ]; then EXTRA_PARAMS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache" fi +if [ "${ARCHITECTURE}" == arm64 ]; then + EXTRA_PARAMS="${EXTRA_PARAMS} -DCMAKE_OSX_ARCHITECTURES=arm64" + export CFLAGS="-arch arm64" + export CXXFLAGS="-arch arm64" +fi + INSTALL_PREFIX=${PWD}/package-data mkdir -p build