talira

Compiler cache that speeds up C and C++ rebuilds

open sourceGPL-3.0-or-laterself-hostablefree

ccache speeds up recompilation of C and C++ (and related languages) by caching previous compilations and detecting when the same compilation is being done again. It wraps the compiler, so it works with existing build systems like Make and CMake. It is a long-standing, widely packaged tool.

Ways to install

Problems it solves

  • make clean then make takes forever on our C++ project
  • switching git branches forces a full rebuild of the C code
  • speed up repeated compiles of the Linux kernel or a big C++ codebase
  • CMake builds in CI recompile every file even when nothing changed
  • cache compiler output without changing the build system
  • rebuilding after touching a header is slow even though most objects are identical
  • Android/AOSP style builds take hours from scratch
  • share a compile cache across build directories on the same machine

Features

  • transparent compiler wrapping
  • direct and depend modes that skip the preprocessor
  • remote caching with custom storage backends
  • C, C++, assembler, CUDA, Objective-C

Capabilities

Has a command line toolplan not known

Alternatives

The same job

These do what ccache does.

  1. Kache Build once. Reuse the work.
  2. sccache Shared compilation cache for C, C++, Rust and CUDA, stored locally or in the cloud
  3. Bazel a fast, scalable, multi-language and extensible build system

Compare ccache with the top 3