CMake: disable compilation of audio loaders/writers if FFmpeg isn't f… #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 with CMake | |
on: [push, pull_request] | |
env: | |
# CMake build type (Debug, Release, RelWithDebInfo or MinSizeRel) | |
BUILD_TYPE: Debug | |
jobs: | |
ubuntu: | |
name: Ubuntu (build and test) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Install dependencies | |
run: sudo apt-get install -y libeigen3-dev libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libsamplerate0-dev libtag1-dev libchromaprint-dev | |
- name: Configure | |
run: cmake -B build | |
- name: Build | |
run: cmake --build build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
run: ctest --test-dir build --output-on-failure -C ${{env.BUILD_TYPE}} | |
macos: | |
name: MacOS (build and test) | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Install dependencies | |
run: brew install cmake eigen libyaml fftw ffmpeg libsamplerate libtag chromaprint | |
- name: Configure | |
run: cmake -B build | |
- name: Build | |
run: cmake --build build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
run: ctest --test-dir build --output-on-failure -C ${{env.BUILD_TYPE}} | |
windows: | |
name: Windows (build and test) | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Install dependencies | |
run: .\packaging\build-dependencies-msvc.bat | |
- name: Configure | |
run: cmake -B build -DUSE_TENSORFLOW=ON -DCMAKE_PREFIX_PATH=%CD%\packaging\msvc | |
- name: Build | |
run: | | |
set PATH=%PATH%;%CD%\packaging\msvc\bin | |
cmake --build build --config ${{env.BUILD_TYPE}} --parallel | |
- name: Test | |
run: | | |
set PATH=%PATH%;%CD%\packaging\msvc\bin | |
ctest --test-dir build --output-on-failure -C ${{env.BUILD_TYPE}} |