Allow compile caching with ccache
ccache is a compiler wrapper that can greatly speed up rebuilds in some cases. To be used with CMake in a general way, the
LAUNCHER facility can be used. A proposed CMake update is in
Enable ccache compiler wrapper when available.
Let CMake use ccache compiler wrapper via `..._LAUNCHER`.
For gcc and compatible compilers, the cost of rebuilding can be greatly
reduced when switching back and forth between branches. If ccache is not
installed or is not given a known-compatible compiler to wrap, this
change has no effect.
Potential side effects should already be familiar to ccache users:
- In some cases, a cache configured to grow too large may lose its benefit.
- If the cache is corrupted, it may need to be removed to restore utility.
We are not using any of the more aggressive caching options, so there
should be no risk of false positives in compile cache hits.
#2 Updated by Eric Irrgang about 2 months ago
- Description updated (diff)
I believe suggestions from code review have been addressed as of patch set 4 on Gerrit. The feature will be quietly on by default, but easily disabled. Output is minimal and idempotent. Conditional activation is conservative, but a note in the developer tools notes suggests adventurous users try out and submit updates when the caching should be applied more aggressively.