Update CMakeLists.txt, add option for docs #19
This file contains 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: Build | |
on: [push, pull_request] | |
jobs: | |
Build: | |
name: ${{ matrix.platform.name }} | |
runs-on: ${{ matrix.platform.os }} | |
defaults: | |
run: | |
shell: ${{ matrix.platform.shell }} | |
strategy: | |
matrix: | |
platform: | |
- { name: Linux, os: ubuntu-20.04, shell: sh, flags: -GNinja } | |
- { name: MacOS, os: macos-latest, shell: sh } | |
- { name: mingw-w64 (i686), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 } | |
- { name: mingw-w64 (x86_64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 } | |
- { name: MSVC (x86), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A Win32", vcpkg: x86-windows } | |
- { name: MSVC (x64), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A x64", vcpkg: x64-windows } | |
- { name: MSVC (ARM64), os: windows-latest, shell: pwsh, flags: "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A ARM64", vcpkg: arm64-windows } | |
steps: | |
- name: Setup Linux dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install cmake ninja-build libsdl2-dev | |
- name: Setup MacOS dependencies | |
if: runner.os == 'MacOS' | |
run: | | |
brew install sdl2 | |
- name: Set up MSYS2 dependencies | |
if: matrix.platform.shell == 'msys2 {0}' | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.platform.msystem }} | |
install: >- | |
${{ matrix.platform.msys-env }}-gcc | |
${{ matrix.platform.msys-env }}-cmake | |
${{ matrix.platform.msys-env }}-ninja | |
${{ matrix.platform.msys-env }}-SDL2 | |
- name: Setup MSVC dependencies | |
if: matrix.platform.vcpkg != '' | |
run: | | |
vcpkg install --triplet ${{ matrix.platform.vcpkg }} sdl2 | |
- name: Get SDL_sound sources | |
uses: actions/checkout@v3 | |
- name: Configure (CMake) | |
run: cmake -B build -DSDLSOUND_DECODER_MIDI=ON ${{ matrix.platform.flags }} -DCMAKE_INSTALL_PREFIX=prefix -DCMAKE_BUILD_TYPE=Release | |
- name: Build (CMake) | |
run: cmake --build build/ --config Release | |
- name: Install (CMake) | |
run: | | |
cmake --install build/ --config Release | |
- name: Verify CMake configuration files | |
run: | | |
cmake -S cmake/test -B build_cmake_test ${{ matrix.platform.flags }} -DCMAKE_PREFIX_PATH="${{ github.workspace }}/prefix" -DCMAKE_BUILD_TYPE=Release | |
cmake --build build_cmake_test --verbose --config Release |