HomePhabricator

[CMAKE] Make ccache to work with clang-tidy

Description

[CMAKE] Make ccache to work with clang-tidy

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.

Reviewers: #bitcoin_abc, markblundeberg

Reviewed By: #bitcoin_abc, markblundeberg

Differential Revision: https://reviews.bitcoinabc.org/D5150

Details

Provenance
FabienAuthored on Feb 4 2020, 12:32
FabienPushed on Feb 4 2020, 12:51
Reviewer
Restricted Project
Differential Revision
D5150: [CMAKE] Make ccache to work with clang-tidy
Parents
rABC40a99e1f0ed3: Automatically add missing braces
Branches
Unknown
Tags
Unknown