NDK r5 with ccache

550 views
Skip to first unread message

Daniel Smith

unread,
Mar 2, 2011, 8:34:11 PM3/2/11
to andro...@googlegroups.com
I originally posted this in android-developers but have just realized that this is probably a much better place to ask (Sorry!)

I had been using ccache ( http://ccache.samba.org/ ) with my NDK builds under r4, and seen some big reductions in compile times (which was nice because, for the life of me, I can't seem to get precompiled headers to work well under cygwin/gcc) .  I've since migrated to r5b, but I'm having trouble successfully integrating the ccache command.
Under r4 it was trivial : simply inserting ccache at the start of gcc commands in ev-compile-cpp-source and ev-compile-c-source. However, in r5 things have moved around somewhat, and using the same technique in ev-build-file causes an error. I will keep persevering, but I'm far from an expert at all things make-y and linux-y, so I was wondering if anyone had any suggestions that would help me get this working?
Thanks!

Daniel Smith

unread,
Jul 14, 2011, 3:18:53 PM7/14/11
to andro...@googlegroups.com
This was actually really simple - now i feel kinda stupid ( i gave up on it before, and just revisited it when i downloaded r6)

Just make the following changes in in build/core/default-build-commands.mk :

TARGET_CC       = ccache $(TOOLCHAIN_PREFIX)gcc
TARGET_CXX      = ccache $(TOOLCHAIN_PREFIX)g++

don't think there any downsides to this and can make rebuilds much faster. You may of course need to install ccache first.
Reply all
Reply to author
Forward
0 new messages