This PR is a proof of concept for using a compilation database with static analysis tools such as clang-tidy or IWYU. The idea was suggested in #32662 (comment):
Shouldn’t this be excluded in the tidy CI task as well?
Additionally, this PR makes use of the codegen
target, following the suggestion in #32662 (comment):
It does seem nice to be able to run clang-tidy on generated files… Maybe more ideally there could be … target like
make --build build -t codegen
that only runs code generation steps and doesn’t compile the sources.
A few tasks remain to be addressed. Here’s the current TODO list:
- Implement the
codegen
target for CMake versions older than 3.31. - Handle files generated by the
mpgen
tool. - Handle files generated by Qt tools.
- Enable
RUN_CHECK_DEPS=true
elsewhere.
While #31965 is still under discussion, it may make sense to move this CI job to GHA to provide quicker feedback.