---
title: "set CCache for building android source code"
author: "seya"
date: "2013-04-24T15:14:23Z"
tags: []
categories: ["移动开发"]
slug: "set-ccache-for-building-android-source-code"
draft: false
lastmod: "2013-04-24T15:14:23Z"
id: 1852877
url: "https://seya.iteye.com/blog/1852877"
---

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 frequentlyswitch 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 downloadedthe source code.

prebuilt/linux-x86/ccache/ccache -M 50G

This setting is stored in the CCACHE_DIR and is persistent.