Android10编译开启ccache

Android10的基线代码google已经将prebuilt的ccache移除,但是保留了相关功能选项

commit 326e7e2cbd95fc2b1a1f858fb29904c9d3974843
Author: Dan Willemsen <dwillemsen@google.com>
Date:   Thu Apr 5 15:48:16 2018 -0700

    Remove our binary of ccache
    
    This version is rather old, and has many known bugs. The build system is
    no longer providing ccache, but preserving the option to use your own at
    your own risk.
    
    Bug: 32748498
    Test: cs/ccache
    Change-Id: I894a11445127bf8cb3a7ac5a119c500f2c572fb9

安卓10之前配置

export USE_CCACHE=true
export CCACHE_DIR=$HOME/.cache
prebuilts/misc/linux-x86/ccache/ccache -M 10G

安卓10+通过使用的HOST操作系统安装对应的ccache软件包

export USE_CCACHE=true
export CCACHE_EXEC=/usr/bin/ccache
export CCACHE_DIR=$HOME/.cache
${CCACHE_EXEC} -M 50G

可以通过如下命令查询cache状态 ccache -s