Setting up 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.
Put the following in your .bashrc or equivalent.
export USE_CCACHE=1
By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.
export CCACHE_DIR=<path-to-your-cache-directory>
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
When building Ice Cream Sandwich (4.0.x) or older, ccache is in a different location:
prebuilt/linux-x86/ccache/ccache -M 50G
This setting is stored in the CCACHE_DIR and is persistent.
本文介绍如何通过配置ccache来提升编译速度。ccache作为一款编译缓存工具,在进行重复编译时能够显著减少编译时间,尤其是在频繁进行make clean操作或者切换不同的构建产品时效果更加明显。文章提供了配置示例,包括设置环境变量以启用ccache,指定缓存目录,以及推荐的缓存大小。
4264

被折叠的 条评论
为什么被折叠?



