How to use ccache selectively?

Posted by Anonymous on Stack Overflow See other posts from Stack Overflow or by Anonymous
Published on 2010-04-22T16:28:21Z Indexed on 2013/10/25 15:54 UTC
Read the original article Hit count: 167

Filed under:
|
|

I have to compile multiple versions of an app written in C++ and I think to use ccache for speeding up the process.

ccache howtos have examples which suggest to create symlinks named gcc, g++ etc and make sure they appear in PATH before the original gcc binaries, so ccache is used instead.

So far so good, but I'd like to use ccache only when compiling this particular app, not always.

Of course, I can write a shell script that will try to create these symlinks every time I want to compile the app and will delete them when the app is compiled. But this looks like filesystem abuse to me.

Are there better ways to use ccache selectively, not always?

For compilation of a single source code file, I could just manually call ccache instead of gcc and be done, but I have to deal with a complex app that uses an automated build system for multiple source code files.

© Stack Overflow or respective owner

Related posts about linux

Related posts about gcc