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 arm64 builds for Mac #4337

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-nightly.yaml
Expand Up @@ -216,7 +216,7 @@ jobs:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64]
arch: [x86_64, arm64]
name: Mac
runs-on: macos-latest
steps:
Expand Down
101 changes: 100 additions & 1 deletion .github/workflows/build-release.yaml
Expand Up @@ -310,11 +310,110 @@ jobs:
${{ steps.generate_package.outputs.package_path }}
${{ steps.generate_package.outputs.debug_path }}

build_mac:
strategy:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64, arm64]
name: Mac
needs: create_release
runs-on: macos-latest
steps:
- name: Cache Qt
id: cache-qt-mac
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-mac.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3

- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: Set up test version
shell: bash
run: |
[[ "${{ github.ref }}" =~ ^refs\/heads\/test\/(.*)$ ]]
# Override the revision string so that the builds are named correctly
echo "set(FSO_VERSION_REVISION_STR ${BASH_REMATCH[1]})" > "version_override.cmake"]
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Package build result
working-directory: ./build
run: cd bin && tar -cvzf macos-build.tar *.app
- name: Upload build result
uses: actions/upload-artifact@v2
with:
name: mac-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/bin/macos-build.tar
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v2
with:
name: mac-Release
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
with:
name: mac-FastDebug
path: builds
- name: Create Distribution package
id: generate_package
working-directory: ./builds
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Mac
- name: Upload result package
uses: actions/upload-artifact@v2
with:
name: ${{ steps.generate_package.outputs.package_name }}
path: ${{ steps.generate_package.outputs.package_path }}
- name: Publish result package
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ steps.generate_package.outputs.package_path }}

post_build:
name: Post builds to Nebula and Forum
needs: [linux_zip, windows_zip]
needs: [linux_zip, windows_zip, mac_zip]
uses: ./.github/workflows/post-build-release.yaml
with:
linux_result: ${{ needs.build_linux.result }}
windows_result: ${{ needs.build_windows.result }}
mac_result: ${{ needs.build_mac.result }}
releaseTag: ${{ github.ref_name }}
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yaml
Expand Up @@ -230,7 +230,7 @@ jobs:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64]
arch: [x86_64, arm64]
name: Mac
runs-on: macos-latest
steps:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/post-build-release.yaml
Expand Up @@ -10,6 +10,9 @@ on:
windows_result: # job.result
required: true
type: string
mac_result: # job.result
required: true
type: string
releaseTag:
required: true
type: string
Expand Down Expand Up @@ -51,6 +54,7 @@ jobs:
env:
LINUX_RESULT: ${{ github.event.inputs.linux_result }}
WINDOWS_RESULT: ${{ github.event.inputs.windows_result }}
MAC_RESULT: ${{ github.event.inputs.mac_result }}
run: python ci/post/main.py release

- name: Post Builds (Manual trigger)
Expand All @@ -59,6 +63,7 @@ jobs:
env:
LINUX_RESULT: success
WINDOWS_RESULT: success
MAC_RESULT: success
run: |
echo "releaseTag= ${{ github.event.inputs.releaseTag }}"
echo "repository= ${{ github.repository }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-pull_request.yaml
Expand Up @@ -162,7 +162,7 @@ jobs:
matrix:
configuration: [Debug, Release]
compiler: [clang]
arch: [x86_64]
arch: [x86_64, arm64]
cmake_options: [""]
name: Mac
runs-on: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion lib/freetype.cmake
@@ -1,7 +1,7 @@

add_library(freetype INTERFACE)

if(PLATFORM_WINDOWS OR PLATFORM_MAC)
if(PLATFORM_WINDOWS)
# We use prebuilt binaries for windows and mac
get_prebuilt_path(PREBUILT_PATH)
set(FREETYPE_ROOT_DIR "${PREBUILT_PATH}/freetype")
Expand Down
2 changes: 2 additions & 0 deletions lib/libpng/CMakeLists.txt
Expand Up @@ -41,6 +41,8 @@ IF (FSO_BUILD_INCLUDED_LIBS OR NOT PNG_FOUND)
target_include_directories(png SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

target_compile_definitions(png PRIVATE "_CRT_SECURE_NO_WARNINGS;$<$<CONFIG:Debug>:PNG_DEBUG=1>")
target_compile_definitions(png PRIVATE PNG_ARM_NEON_IMPLEMENTATION=0) # Disable NEON to fix Mac ARM builds
target_compile_definitions(png PRIVATE PNG_ARM_NEON_OPT=0)

IF(BUILD_SHARED_LIBS)
target_compile_definitions(png INTERFACE PNG_BUILD_DLL)
Expand Down