Skip to content

Commit

Permalink
Merge pull request #1 from 17451k/arm64
Browse files Browse the repository at this point in the history
Add arm64 builds for macOS
  • Loading branch information
atomb authored Jul 24, 2023
2 parents e81b4f1 + 8b7f453 commit 3d9e7f9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-20.04, macos-11, macos-12, windows-2019]
arch: [x64]
solver: [z3-4.8.5, z3-4.12.1]
include:
- os: macos-11
arch: arm64
solver: z3-4.12.1
- os: macos-12
arch: arm64
solver: z3-4.12.1
steps:
- name: Check out
uses: actions/checkout@v3
Expand All @@ -38,16 +46,16 @@ jobs:

- name: Build (non-Windows)
shell: bash
run: scripts/build.sh ${{ matrix.solver }}
run: scripts/build.sh ${{ matrix.solver }} ${{ matrix.arch }}
if: runner.os != 'Windows'

- name: Build (Windows)
shell: msys2 {0}
run: scripts/build.sh ${{ matrix.solver }}
run: scripts/build.sh ${{ matrix.solver }} ${{ matrix.arch }}
if: runner.os == 'Windows'

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
path: bin
name: ${{ matrix.solver }}-${{ matrix.os }}-bin
name: ${{ matrix.solver }}-${{ matrix.arch }}-${{ matrix.os }}-bin
19 changes: 17 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
set -Eeuxo pipefail

SOLVER=$1
ARCH=$2

BIN=$(pwd)/bin
mkdir -p $BIN

Expand All @@ -16,12 +18,25 @@ case "$RUNNER_OS" in
EXECUTABLE_EXT=".exe"
esac

case "$ARCH" in
arm64)
ARCH_OPT="--arm64=true"
;;
*)
ARCH_OPT=""
;;
esac

pushd repos/$SOLVER
if [[ "$RUNNER_OS" == 'Windows' ]] ; then
sed -i.bak -e 's/STATIC_BIN=False/STATIC_BIN=True/' scripts/mk_util.py
fi
python scripts/mk_make.py
python scripts/mk_make.py $ARCH_OPT
(cd build && make -j4 && cp z3$EXECUTABLE_EXT $BIN/$SOLVER$EXECUTABLE_EXT)
strip $BIN/$SOLVER$EXECUTABLE_EXT
$BIN/$SOLVER$EXECUTABLE_EXT --version

if [[ "$ARCH" == 'x64' ]] ; then
$BIN/$SOLVER$EXECUTABLE_EXT --version
fi

popd

0 comments on commit 3d9e7f9

Please sign in to comment.