使用 ccache 优化c/c++ 编译速度

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
 

你可能感兴趣的:(测试)