启用ccache加速编译android源代码


当你删掉out/target目录或者使用make clean清空输出重新编译源码的时候,编译时间通常都很漫长。

其实这个问题很容易解决,Android官方为我们带来了解决方案–ccache编译器缓存。
官方这么讲:
You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do “make clean” often, or if you frequently switch between different build products.
设置方法:
在你home主目录的.bashrc中加入:
export USE_CCACHE=1
如果你需要指定一个特殊的缓存目录,也需要在.bashrc中加入,不指定则为你当前用户目录下的.ccache。
export CCACHE_DIR=/home/mokee/.ccache
在MoKee OpenSource主目录中运行,50G~100G之间手动指定:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
大功告成,开始编译吧!
 
转载自魔趣论坛,http://bbs.mfunz.com/thread-686486-1-1.html

合作联系邮箱:cofface#cofface.com(请将#替换为@)

转载请注明来源:Cofface Blog » 启用ccache加速编译android源代码

赞 (3) 打赏

感谢您的支持,我会继续努力的!

支付宝扫一扫打赏