Skip to content

Updated for the latest SDL changes #13

Updated for the latest SDL changes

Updated for the latest SDL changes #13

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows (MSVC), os: windows-2019, shell: sh, msvc: 1 }
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: Linux, os: ubuntu-22.04, shell: sh }
- { name: Macos, os: macos-latest, shell: sh }
steps:
- name: Set up MSYS2
if: matrix.platform.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msystem }}
install: >-
${{ matrix.platform.msys-env }}-SDL2
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-gcc
${{ matrix.platform.msys-env }}-ninja
- name: Setup Macos dependencies
if: runner.os == 'macOS'
run: |
brew install \
sdl2 \
ninja \
${NULL+}
- name: Setup Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -y install \
cmake \
libsdl2-dev \
ninja-build \
pkg-config \
${NULL+}
- uses: actions/checkout@v3
- name: Setup MSVC dependencies
if: "matrix.platform.msvc"
shell: pwsh
run: |
echo "::group::Downloading SDL"
.github/fetch_sdl_vc.ps1
echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/SDL2-devel-VC" >> $Env:GITHUB_ENV
echo "::endgroup::"
- name: Setup Ninja for MSVC
if: "matrix.platform.msvc"
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.10.2
- uses: ilammy/msvc-dev-cmd@v1
if: "matrix.platform.msvc"
with:
arch: x64
- name: Configure (CMake)
run: |
cmake -S . -B build \
-DSDLGESTURE_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build (CMake)
run: |
cmake --build build/ --config Release --parallel --verbose
- name: Install (CMake)
run: |
set -eu
rm -fr prefix_cmake
cmake --install build/ --config Release
( cd prefix; find . ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S test -B cmake_config_build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$PWD/prefix"
cmake --build cmake_config_build --verbose --config Release