Ccache helps developers save valuable time by reusing previously compiled objects, significantly reducing build times during recompilation. However, a common challenge when working with Ccache is figuring out which configuration options are currently active. Because its behavior depends on settings like cache size, compression, and directory paths, being able to quickly check and understand these options is important for troubleshooting and optimizing builds. This tutorial explains how to get current configuration options in Ccache.
We can use the --show-config
option (or its shorthand -p
) to display current configuration options:
ccache --show-config
ccache -p
Here are some of the most important ones:
(default) cache_dir = /home/ubuntu/.cache/ccache
(default) compression = true
(default) compression_level = 0
(default) max_files = 0
(default) max_size = 5.0 GiB
(default) stats = true
(default) temporary_dir = /run/user/1000/ccache-tmp
cache_dir
- path, where Ccache stores all cached compilation results.compression
- whether cache files are stored in compressed form.compression_level
- the level at which Ccache will compress an object file. The value 0 means that Ccache automatically select an appropriate level.max_files
- the maximum number of files allowed in the cache. The value 0 means unlimited.max_size
- the maximum disk space the cache may use.stats
- whether Ccache keeps track of cache statistics.temporary_dir
- directory used for temporary files.
Leave a Comment
Cancel reply