tags:

views:

47

answers:

1

I am trying to use ccache with CMake. I have placed symlinks named gcc, g++ and c++ in /usr/local/bin. If I run make, add some change to CMakeLists.txt that does not affect the compiled files (add unused library just to force make build all the targets) and re-run make, everything is recompiled as if there was no ccache. However, if I remove all CMake-generated files and then call cmake; make, everything works fine, and object files are retrieved from cache, even if I change CMakeLists.txt.

Looks like something CMake-generated prevents hitting the cache. I tried searching through verbose output of both make and cmake, but could not find any dependencies that could cause this behaviour.

A: 

I suggest that you install ccache 3.0 (released just some days ago) and set CCACHE_LOGFILE to a file. ccache will then print what it's doing to that file and you will probably get a clue about the problem.

Joel Rosdahl