Add vcpkg SDL3 to CI and update UI demo to use UiState; require SDL3 CONFIG in CMake #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CMake on multiple platforms | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-2025] | |
| build_type: [Release] | |
| c_compiler: [gcc, clang, cl] | |
| include: | |
| - os: windows-2025 | |
| c_compiler: cl | |
| cpp_compiler: cl | |
| vcpkg_triplet: x64-windows | |
| vcpkg_commit_id: 1e199d32ad53aab1defda61ce41c380302e3f95c | |
| - os: ubuntu-latest | |
| c_compiler: gcc | |
| cpp_compiler: g++ | |
| vcpkg_triplet: x64-linux | |
| vcpkg_commit_id: 1e199d32ad53aab1defda61ce41c380302e3f95c | |
| - os: ubuntu-latest | |
| c_compiler: clang | |
| cpp_compiler: clang++ | |
| vcpkg_triplet: x64-linux | |
| vcpkg_commit_id: 1e199d32ad53aab1defda61ce41c380302e3f95c | |
| exclude: | |
| - os: windows-2025 | |
| c_compiler: gcc | |
| - os: windows-2025 | |
| c_compiler: clang | |
| - os: ubuntu-latest | |
| c_compiler: cl | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'true' | |
| - name: Install development packages | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| autoconf autoconf-archive automake libtool libltdl-dev \ | |
| build-essential git make pkg-config cmake ninja-build \ | |
| gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev \ | |
| libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev \ | |
| libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev \ | |
| libxtst-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev \ | |
| libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev \ | |
| libudev-dev libthai-dev libpipewire-0.3-dev libwayland-dev \ | |
| libdecor-0-dev liburing-dev | |
| - name: Setup vcpkg | |
| id: runvcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' | |
| vcpkgGitCommitId: '${{ matrix.vcpkg_commit_id }}' | |
| - name: Install SDL3 via vcpkg | |
| run: vcpkg install sdl3:${{ matrix.vcpkg_triplet }} | |
| - name: Set reusable strings | |
| id: strings | |
| shell: bash | |
| run: | | |
| echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
| - name: Configure CMake | |
| run: > | |
| cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
| -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake | |
| -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} | |
| -S ${{ github.workspace }} | |
| - name: Build | |
| run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} |