Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macOS arm64 builds #7285

Merged
merged 2 commits into from
May 31, 2024
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
20 changes: 16 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,19 @@ jobs:
env:
CCACHE_MAXSIZE: 500M
macos:
name: macos
runs-on: macos-12
strategy:
fail-fast: false
matrix:
arch: [ x86_64, arm64 ]
include:
- arch: x86_64
os: macos-12
xcode: "13.1"
- arch: arm64
os: macos-14
xcode: "14.3.1"
name: macos-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
Expand All @@ -74,7 +85,7 @@ jobs:
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j3
DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- name: Check out
uses: actions/checkout@v3
Expand Down Expand Up @@ -115,6 +126,7 @@ jobs:
-B build \
-DCMAKE_INSTALL_PREFIX="../target" \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)" \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \
$CMAKE_OPTS \
-DUSE_WERROR=OFF
- name: Build
Expand All @@ -130,7 +142,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: macos
name: macos-${{ matrix.arch }}
path: build/lmms-*.dmg
- name: Trim ccache and print statistics
run: |
Expand Down
13 changes: 12 additions & 1 deletion cmake/apple/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ CONFIGURE_FILE("lmms.plist.in" "${CMAKE_BINARY_DIR}/Info.plist")
CONFIGURE_FILE("install_apple.sh.in" "${CMAKE_BINARY_DIR}/install_apple.sh" @ONLY)
CONFIGURE_FILE("package_apple.json.in" "${CMAKE_BINARY_DIR}/package_apple.json" @ONLY)

IF(CMAKE_OSX_ARCHITECTURES)
SET(DMG_ARCH "${CMAKE_OSX_ARCHITECTURES}")
ELSEIF(IS_ARM64)
# Target arch is host arch
SET(DMG_ARCH "arm64")
ELSE()
# Fallback to Intel
SET(DMG_ARCH "x86_64")
ENDIF()

# DMG creation target
SET(DMG_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}.dmg")
SET(DMG_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}-${DMG_ARCH}.dmg")

FILE(REMOVE "${DMG_FILE}")
ADD_CUSTOM_TARGET(removedmg
COMMAND touch "\"${DMG_FILE}\"" && rm "\"${DMG_FILE}\""
Expand Down
Loading