Merge pull request #2500 from gforney/jpeg3 #2472
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 Build | |
| on: [push, pull_request] | |
| jobs: | |
| build_unix_gcc: | |
| # Set the name of this build, variable depending on the OS | |
| name: build ${{ matrix.os }} - ${{ matrix.compiler }} - ${{ matrix.build }} - ${{ matrix.vendored_libs == 'ON' && 'vendored_libs' || 'system_libs' }} | |
| strategy: | |
| fail-fast: false | |
| # The matrix sets all the different combinations of builds, e.g. platforms | |
| # and build configurations | |
| matrix: | |
| os: | |
| - ubuntu-24.04 | |
| - macos-15 | |
| compiler: | |
| - gcc | |
| - clang | |
| build: | |
| - Debug | |
| - Release | |
| vendored_libs: | |
| - ON | |
| - OFF | |
| # Set the platform to build on | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| # Check out the smv repo | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # If we are currently building on Linux (ubuntu) install all the native | |
| # pre-requisites | |
| - name: Install linux deps | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install build-essential freeglut3-dev libx11-dev libxmu-dev libxi-dev libglew-dev libgd-dev libjson-c-dev | |
| # If we are building on macos configure the environment to use gcc-14 as | |
| # the compiler | |
| - name: set macos gcc | |
| if: runner.os == 'macOS' && matrix.compiler == 'gcc' | |
| shell: bash | |
| run: | | |
| echo "CC=gcc-14" >> $GITHUB_ENV | |
| echo "CXX=g++-14" >> $GITHUB_ENV | |
| brew install glew gd zlib json-c | |
| - name: set macos gcc | |
| if: runner.os == 'macOS' && matrix.compiler == 'clang' | |
| shell: bash | |
| run: | | |
| echo "CC=clang" >> $GITHUB_ENV | |
| echo "CXX=clang" >> $GITHUB_ENV | |
| brew install glew gd zlib json-c | |
| # If we are building on linux configure the environment to use gcc as the | |
| # compiler | |
| - name: set linux gcc | |
| if: runner.os == 'Linux' && matrix.compiler == 'gcc' | |
| shell: bash | |
| run: | | |
| echo "CC=gcc" >> $GITHUB_ENV | |
| echo "CXX=g++" >> $GITHUB_ENV | |
| - name: set linux gcc | |
| if: runner.os == 'Linux' && matrix.compiler == 'clang' | |
| shell: bash | |
| run: | | |
| echo "CC=clang" >> $GITHUB_ENV | |
| echo "CXX=clang" >> $GITHUB_ENV | |
| # Run cmake to build smokeview | |
| - name: Build | |
| shell: bash | |
| run: | | |
| cmake \ | |
| -B ${{github.workspace}}/cbuild \ | |
| -DSTRICT_CHECKS=ON \ | |
| -DVENDORED_LIBS=${{ matrix.vendored_libs }} \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build }} \ | |
| -DCMAKE_C_COMPILER=${{ matrix.compiler }} | |
| cmake --build ${{github.workspace}}/cbuild -j4 -v | |
| # Run the CMake-based tests on MacOS | |
| - name: Test | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| ctest --test-dir cbuild -j10 --output-on-failure -V | |
| # Run the CMake-based tests on Linux | |
| - name: Test | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| xvfb-run ctest --test-dir cbuild -j10 --output-on-failure -V | |
| build_windows_msvc: | |
| name: build ${{ matrix.os }} - ${{ matrix.compiler }} - ${{ matrix.build }} - ${{ matrix.vendored_libs == 'ON' && 'vendored_libs' || 'system_libs' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - windows-2022 | |
| compiler: | |
| - cl | |
| - clang | |
| build: | |
| - Debug | |
| - Release | |
| vendored_libs: | |
| - ON | |
| - OFF | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Pin vcpkg version | |
| run: | | |
| cd C:\vcpkg | |
| git fetch | |
| git checkout 5c6220035e9de2741e9f55571d63e4f97839b36e | |
| .\\bootstrap-vcpkg.bat | |
| - name: build smokeview | |
| shell: cmd | |
| run: | | |
| cmake --version | |
| cmake -B ${{github.workspace}}\cbuild ^ | |
| -DSTRICT_CHECKS=ON ^ | |
| ${{ matrix.compiler == 'clang' && '-GNinja' || '' }} ^ | |
| -DVENDORED_LIBS=${{ matrix.vendored_libs }} ^ | |
| -DVENDORED_UI_LIBS=ON ^ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build }} ^ | |
| -DCMAKE_C_COMPILER=${{ matrix.compiler }} ^ | |
| ${{ matrix.vendored_libs == 'OFF' && '-DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake' || '' }} | |
| cmake --build ${{github.workspace}}\cbuild -j4 --config ${{ matrix.build }} -v | |
| - name: Test | |
| shell: bash | |
| working-directory: ${{github.workspace}}/cbuild | |
| run: | | |
| ctest -j10 -C ${{ matrix.build }} --output-on-failure |