aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/cmake.yml
blob: 8e6cedf8c768937388a7b5d40e50d853a8db36e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: CMake

on:
  push:
  pull_request:

env:
  BUILD_TYPE: Release

jobs:
  build:
    strategy:
      matrix:
        include:
          - name: ubuntu-latest-gcc-cmake
            os: ubuntu-latest
            cc: gcc
            cxx: g++
            build-system: cmake
            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=0'

          - name: ubuntu-latest-clang-cmake
            os: ubuntu-latest
            cc: clang
            cxx: clang++
            build-system: cmake
            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=1'

          - name: macos-latest-clang-cmake
            os: macos-latest
            cc: clang
            cxx: clang++
            build-system: cmake
            cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=0'

          - name: windows-latest-vs-cmake
            os: windows-latest
            cc: clang
            cxx: clang++
            build-system: cmake
            cmake-opts: '-G "Visual Studio 17 2022" -DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_INSTALL=0 -DUHDR_BUILD_FUZZERS=0'

    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v3

    - name: Configure CMake
      env:
        CC: ${{ matrix.cc }}
        CXX: ${{ matrix.cxx }}
      run: cmake -B ${{github.workspace}}/out -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.cmake-opts }}

    - name: Build
      run: cmake --build ${{github.workspace}}/out --config ${{env.BUILD_TYPE}}