Page MenuHomePhabricator

[CMAKE] Make ccache to work with clang-tidy
ClosedPublic

Authored by Fabien on Feb 4 2020, 12:44.

Details

Summary

When using the RULE_LAUNCH_COMPILE and RULE_LAUNCH_LINK properties,
ccache is called on the cmake invocation instead of clang-tidy,
which makes it inefficient.
Using the C|CXX_COMPILER_LAUNCHER properties instead fixes the issue.
See https://gitlab.kitware.com/cmake/cmake/merge_requests/1791.

I moved the ccache check into src/CMakeLists.txt since it applies to
C/CXX compilation.

Test Plan

With ccache enabled:

ninja

Delete you build directory, then run again:

ninja

Check the build performance increased thanks to ccache.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable