Skip to content

Commit

Permalink
Different attempt to make this build on ARM Mac.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Jun 30, 2024
1 parent 5afc065 commit 3c15016
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/swiftshader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ env:
# Ideally use a commit that's verified to work well elsewhere (Arch
# swiftshader-git package, for example)
COMMIT: a6940c8e6eb0c61c433ed4b61ae04c12ff37bfbb
# This one includes a fix for building on ARM64 on macOS, and hopefully
# doesn't cause any other breakage
COMMIT_MAC: 14dcbed947ce755af1fcbfb3ba8e643b4e769860

# Mostly just copied from here, with ES1 disabled:
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=swiftshader-git
Expand Down Expand Up @@ -229,7 +232,7 @@ jobs:
uses: actions/checkout@v4.1.7
with:
repository: google/swiftshader
ref: ${{ env.COMMIT }}
ref: ${{ env.COMMIT_MAC }}
path: swiftshader
# Yeah, I know, but the repo has no tags, and we use number of commits
# for SWIFTSHADER_VERSION.
Expand All @@ -241,15 +244,6 @@ jobs:
SWIFTSHADER_VERSION="r$(git -C swiftshader rev-list --count HEAD).$(git -C swiftshader rev-parse --short=10 HEAD)"
echo "version: $SWIFTSHADER_VERSION"
echo "SWIFTSHADER_VERSION=$SWIFTSHADER_VERSION" >> $GITHUB_ENV
- name: Patch CMakeLists to not force x86_64
# Even with CMAKE_OSX_ARCHITECTURES="arm64" I get
# clang: error: the clang compiler does not support '-march=x86-64'
# No idea what's off, whether it's CMake being broken on this image or
# the old version doing something silly, so just replacing everything to
# build just an ARM variant always. Additionally, on
# macOS sed -i is weird: https://stackoverflow.com/a/4247319
run: |
sed -i'' -e "s/set(ARCH \"x86_64\")/set(ARCH \"aarch64\")/g" swiftshader/CMakeLists.txt
- name: Configure
run: |
cmake \
Expand Down

0 comments on commit 3c15016

Please sign in to comment.