Skip to content

Commit

Permalink
GH Actions: install include-what-you-use, integrate it with CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Jun 19, 2024
1 parent 8cd75f2 commit 9b10c10
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,28 @@ jobs:
- '20'
steps:
- uses: actions/checkout@v4
- name: restore
- name: install GoogleTest
run: |
sudo apt-get update
sudo apt-get install -y libgtest-dev
- name: install include-what-you-use (iwyu)
# NB: https://packages.ubuntu.com/jammy/iwyu apparently doesn't declare the `libclang-common-XXX-dev` package it
# needs as a dependency (without it, `include-what-you-use` fails with "fatal error: 'stddef.h' file not found"
# or similar), although this problem has been reported in 7 out of 7 bug reports at
# https://bugs.launchpad.net/ubuntu/+source/iwyu, the oldest one is from 2014.
#
# We intentionally specify an exact version of `iwyu` here, so that when a new version becomes available and we
# want to update to it, we'll have to change this hardcoded version manually and update the
# `libclang-common-XXX-dev` version accordingly (see
# https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md#clang-compatibility).
run: sudo apt-get install -y iwyu=8.17-1 libclang-common-13-dev
- name: build
env:
CPP_STANDARD: ${{ matrix.cpp-standard }}
run: .build/build -DCMAKE_CXX_STANDARD="$CPP_STANDARD" -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF
run: |
.build/build \
-DCMAKE_CXX_STANDARD="$CPP_STANDARD" -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE='include-what-you-use;-Xiwyu;--verbose=3'
- name: unittest
run: .build/run-unittest

Expand Down

0 comments on commit 9b10c10

Please sign in to comment.