• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CMake
2
3on:
4  push:
5  pull_request:
6
7env:
8  BUILD_TYPE: Release
9
10jobs:
11  build:
12    strategy:
13      matrix:
14        include:
15          - name: ubuntu-latest-gcc-cmake
16            os: ubuntu-latest
17            cc: gcc
18            cxx: g++
19            build-system: cmake
20            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=0'
21
22          - name: ubuntu-latest-gcc-cmake-deps
23            os: ubuntu-latest
24            cc: gcc
25            cxx: g++
26            build-system: cmake
27            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=0 -DUHDR_BUILD_DEPS=1'
28
29          - name: ubuntu-latest-clang-cmake
30            os: ubuntu-latest
31            cc: clang
32            cxx: clang++
33            build-system: cmake
34            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=0'
35
36          - name: ubuntu-latest-clang-cmake-deps
37            os: ubuntu-latest
38            cc: clang
39            cxx: clang++
40            build-system: cmake
41            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_DEPS=1'
42
43          - name: ubuntu-latest-clang-cmake-fuzzers
44            os: ubuntu-latest
45            cc: clang
46            cxx: clang++
47            build-system: cmake
48            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=1'
49
50          - name: macos-latest-clang-cmake
51            os: macos-latest
52            cc: clang
53            cxx: clang++
54            build-system: cmake
55            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=0'
56
57          - name: macos-latest-clang-cmake-deps
58            os: macos-latest
59            cc: clang
60            cxx: clang++
61            build-system: cmake
62            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_DEPS=1'
63
64          - name: windows-latest-vs-cmake
65            os: windows-latest
66            cc: clang
67            cxx: clang++
68            build-system: cmake
69            cmake-opts: '-G "Visual Studio 17 2022" -DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_DEPS=1 -DUHDR_BUILD_FUZZERS=0'
70
71    runs-on: ${{ matrix.os }}
72
73    steps:
74    - uses: actions/checkout@v4
75
76    - name: Install MacOS dependencies
77      if: startsWith(matrix.os,'macos')
78      run: |
79        brew update
80        brew install pkg-config jpeg-turbo
81
82    - name: Install Linux dependencies
83      if: startsWith(matrix.os,'ubuntu')
84      run: |
85        sudo apt-get update
86        sudo apt-get install -y libjpeg-dev
87
88    - name: Configure CMake
89      env:
90        CC: ${{ matrix.cc }}
91        CXX: ${{ matrix.cxx }}
92      run: cmake -B ${{github.workspace}}/out -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.cmake-opts }}
93
94    - name: Build
95      run: cmake --build ${{github.workspace}}/out --config ${{env.BUILD_TYPE}}
96