ccache的使用

来源:互联网 发布:淘宝客优惠券采集工具 编辑:程序博客网 时间:2024/06/03 20:50

ccache编译器缓存,第一次编译时ccache缓存了GCC -E输出,把那些头文件展开信息保存在缓存中
当第二次编译时会尽量得用缓存,有改动时会更新缓存\
1.安装:
apt-get install ccache
# which ccache
/usr/local/bin/ccache
2.导出到环境变量
vi ~/.bashrc
#ccache
export USE_CCACHE=1
export CCACHE_DIR=/home/xx/tools/.ccache
3.设置ccache的大小
ccache -M 50G
4.查看ccache的信息
# ccache -s
cache directory                     /home/xx/tools/.ccache
cache hit (direct)                 79521
cache hit (preprocessed)            2589
cache miss                        127838
called for link                    29051
called for preprocessing            1687
compile failed                        65
preprocessor error                 31244
can't use precompiled header          84
couldn't find the compiler          3795
unsupported source language        26791
unsupported compiler option          127
no input file                       8108
files in cache                    373791
cache size                          40.4 Gbytes //编译android已经用了40.4个G了
max cache size                      50.0 Gbytes
5.清除所有
ccache -C

原创粉丝点击