Skip to content

Commit

Permalink
Update cmake-sdl2.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
JunaMeinhold authored Oct 20, 2024
1 parent 31fb873 commit 15c43fa
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/cmake-sdl2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,25 @@ jobs:
include:
- os: ubuntu-latest
arch: x86_64
cmake-arch: x64
- os: ubuntu-latest
arch: arm64
cmake-arch: aarch64
- os: windows-latest
arch: x86_64
cmake-arch: x64
- os: windows-latest
arch: x86
cmake-arch: win32
- os: windows-latest
arch: arm64
cmake-arch: arm64
- os: macos-latest
arch: x86_64
cmake-arch: x86_64
- os: macos-latest
arch: arm64
cmake-arch: arm64
steps:
- uses: actions/checkout@v4.1.7
with:
Expand Down Expand Up @@ -66,32 +73,34 @@ jobs:
libxkbcommon-dev \
libsndio-dev
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
- name: Install Cross-Compilation Tools for ARM64
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
run: |
brew update
brew install cmake
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- name: Configure cimgui with CMake for ARM64 on Linux
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
run: cmake -S SDL -B SDL/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++

- name: Configure cimgui with CMake on Linux (x86_64)
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64'
run: cmake -S SDL -B SDL/build

- name: Configure SDL2 with CMake for macOS ARM64
if: matrix.arch == 'arm64' && matrix.os == 'macos-latest'
run: cmake -S SDL -B SDL/build -DCMAKE_OSX_ARCHITECTURES=arm64 -DSDL_STATIC=OFF -DSDL_SHARED=ON
if: matrix.os == 'macos-latest'
run: cmake -S SDL -B SDL/build -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake-arch }} -DSDL_STATIC=OFF -DSDL_SHARED=ON

- name: Configure SDL2 with CMake
if: matrix.arch != 'arm64' || matrix.os != 'macos-latest'
run: cmake -S SDL -B SDL/build -DSDL_STATIC=OFF -DSDL_SHARED=ON
- name: Configure cimgui with CMake for Windows
if: matrix.os == 'windows-latest'
run: cmake -S SDL -B SDL/build -A ${{ matrix.cmake-arch }}

- name: Build SDL2
run: cmake --build SDL/build --config Release

- name: Upload Artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-artifacts
name: sdl2-${{ matrix.os }}-${{ matrix.arch }}-artifacts
path: |
SDL/build/Release/*.dll
SDL/build/*.so
Expand Down

0 comments on commit 15c43fa

Please sign in to comment.