User forums > Help

ccache to speed up builds

(1/7) > >>

Smirftsch:
I digged a while and tried some settings, but I can't seem to be able to add ccache in CodeBlocks to speed up my builds. Where do I have to add it? Probably I'm just blind...:)

oBFusCATed:
Probably the easiest way is to make a bash script and replace your toolchain executable with the script ( settings -> compiler & debugger -> toolchain executable).

Create a file ccache_gcc.sh and fill it with:

--- Code: ---#!/bin/bash
ccache gcc "$@"

--- End code ---

The in the field for C compiler type ccache_gcc.sh, do the same for C++...
Also you should change your "Compiler's installation dir and do some symbolic linking for the non ccached tools.

p.s. I've not tested the script, so it is possible that it doesn't work (I'm not a ccache user)
p.p.s. you could try to use "ccache gcc" directly, but I doubt it will work

Smirftsch:
No, ccache gcc doesn't work. Tried that already ;) - but I'm surprised that no one here seems to use it,even a search in the forums showed nothing really related. While it is some really important thing in my eyes, especially when comparing against vc++ it really takes way longer to recompile my project in C::B without it.

Maybe most people are just not aware about it?
http://ccache.samba.org/performance.html
just for information.

I really suggest to add such an option to use it in C::B maybe as checkbox. If testing minor changes in big projects it can safe hours of work.

PS: Thx for the idea with the script, seems to work fine ;)

Update: while it executes ccache now it doesn't seem to do its work. Maybe some path issue, so its not working yet...

reckless:
#!/bin/sh
ccache gcc "$@"

works fine here :) need to tell the program youre compiling that it needs to use the wrapper.

i.e
export CC="ccache_gcc"

reckless:
forgot to mention dont call it ccache_gcc.sh just ccache_gcc .sh files call bash directly while scripts with #!/bin/bash
are actually handled like real executables

Navigation

[0] Message Index

[#] Next page

Go to full version