Skip to content

Commit

Permalink
ci: build arm64 linux binary
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Jun 12, 2024
1 parent e2a5c30 commit d62cd4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
platform:
- { name: 'Linux', arch: 'x64', os: ubuntu-latest, werror: true }
- { name: 'Linux', arch: 'arm64', os: ubuntu-latest, werror: true }
- { name: 'Linux', arch: 'arm64', os: ubuntu-latest, werror: true, cmake-toolchain-file: 'cmake/toolchains/linux-aarch64.cmake', apt-packages: 'gcc-aarch64-linux-gnu g++-aarch64-linux-gnu', cross: true }
- { name: 'MacOS', arch: 'arm64-x64', os: macos-latest, werror: true, cmake-args: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
- { name: 'Windows', arch: 'Win32', os: windows-latest }
- { name: 'Windows', arch: 'x64', os: windows-latest }
Expand All @@ -40,12 +40,13 @@ jobs:
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y libgl-dev
sudo apt-get install -y libgl-dev ${{ matrix.platform.apt-packages }}
- name: Set up SDL
uses: libsdl-org/setup-sdl@main
with:
cmake-arguments: ${{ matrix.platform.cmake-args }}
cmake-generator: Ninja
cmake-toolchain-file: ${{ matrix.platform.cmake-toolchain-file }}
version: 2-latest
add-to-environment: true

Expand All @@ -64,11 +65,13 @@ jobs:
-DDETHRACE_INSTALL=ON \
-DDETHRACE_PACKAGE_PLATFORM=${{ matrix.platform.name }} \
-DDETHRACE_PACKAGE_ARCH=${{ matrix.platform.arch }} \
-DCMAKE_TOOLCHAIN_FILE=${{ matrix.platform.cmake-toolchain-file }} \
${{ matrix.platform.cmake-args }}
- name: 'Build (CMake)'
run: |
cmake --build build
- name: 'Test (CTest)'
if: ${{ !matrix.platform.cross }}
run: |
ctest --test-dir build --verbose
- name: 'Package (CPack)'
Expand Down
4 changes: 4 additions & 0 deletions cmake/toolchains/linux-aarch64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "arm64")
set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")

0 comments on commit d62cd4f

Please sign in to comment.