Skip to content

Support optional use of `clang-scan-deps` for dependency scanning

Jürg Billeter requested to merge juerg/clang-scan-deps into master

clang-scan-deps is a tool for fast dependency scanning of a whole project. This reduces the overhead of recc when invoked multiple times for the source files of a single project. This works correctly only if the sources are not modified between recc invocations.

This is enabled by setting RECC_COMPILATION_DATABASE to the filename of the compilation database. If the compilation database doesn't exist, clang-scan-deps is not available or an error occurs, recc will fall back to using the compiler to determine dependencies.

CMake supports generating a compilation database named compile_commands.json by setting CMAKE_EXPORT_COMPILE_COMMANDS=ON

This MR is limited to actions where clang is used as compiler. Support for gcc is in progress as follow-up.

Fixes #61 (closed).

Edited by Jürg Billeter

Merge request reports