Android10开启ccache

Android10开启ccache

背景

开启ccache 加速安卓代码编译

新的改变

  1. 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=/data/workspace/Patch_Build_WT/.ccache(可选参数 默认用户主目录下)
prebuilts/misc/linux-x86/ccache/ccache -M 10G

安卓10

1. 由于默认代码gogle已经移除 所以需要自己安装ccache服务 deb系列的发行版apt就可以安装或者

ccache下载最新的源码编译安装 再次不废话(网上很多教材)

  1. 配置
export USE_CCACHE=true
export CCACHE_EXEC=/usr/bin/ccache
export CCACHE_DIR=/data/workspace/Patch_Build_WT/.ccache(可选参数 默认用户主目录下)
${CCACHE_EXEC} -M 50G

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

ccache -s

cache directory                     /data/workspace/Patch_Build_WT/.ccache
primary config                      /data/workspace/Patch_Build_WT/.ccache/ccache.conf
secondary config      (readonly)    /etc/ccache.conf
cache hit (direct)                   431
cache hit (preprocessed)               0
cache miss                         86472
called for link                       96
called for preprocessing              52
compile failed                         1
preprocessor error                    78
couldn't find the compiler             1
unsupported source language         4490
files in cache                    156104
cache size                          30.5 GB
max cache size                      50.0 GB
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值