1

When I use ccache -s, I get like this.

root@iZwz98um4r4f2aucz24e1yZ:~# ccache -s
cache directory                     /root/.ccache
primary config                      /root/.ccache/ccache.conf
secondary config      (readonly)    /etc/ccache.conf

But when I set different environment CCACHE_DIR for my different C++ projects, how can I get my CCACHE_DIR statistics? Is there parameters can do this?

losy
  • 11
  • 1

2 Answers2

1

The way to do it is to set the CCACHE_DIR (temporarily if you want) when running ccache -s, for instance like this:

CCACHE_DIR=/path/to/the/cache/dir ccache -s
Joel Rosdahl
  • 846
  • 9
  • 12
0

As per the documentation:

-d, --dir PATH

Let the command line options operate on cache directory PATH instead of the default. For example, to show statistics for a cache directory at /shared/ccache you can run ccache -d /shared/ccache -s. Using this option has the same effect as setting the environment variable CCACHE_DIR temporarily.

Available from Ccache version 4.0 onwards.

Maarten Bamelis
  • 2,243
  • 19
  • 32