select.mk: Tune ccache options

With these adjustments, cached object files can now be shared across
multiple Android trees on a single workstation:

* Compiler binary modification time no longer causes cache misses,
  as a hash of the compiler binary is taken rather than looking
  at the mtime and size
* Header file modification time no longer causes cache misses,
  the headers are now always hashed
* Macros such as __DATE__ and __TIME__ no longer cause cache misses
* All paths in preprocessed source (due to use of -g) are now relative

These options require ccache 3.1 or later to be used; ccache 2.4 will
ignore these.

Change-Id: I7839637e9dacf7240bd9b7bfaa6406b1db423560
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2012-08-13 13:45:50 -07:00
parent 20e713d151
commit 1f93043c86
1 changed files with 17 additions and 0 deletions

View File

@ -60,6 +60,23 @@ $(combo_target)STATIC_LIB_SUFFIX := .a
include $(BUILD_COMBOS)/$(combo_target)$(combo_os_arch).mk
ifneq ($(USE_CCACHE),)
# The default check uses size and modification time, causing false misses
# since the mtime depends when the repo was checked out
export CCACHE_COMPILERCHECK := content
# See man page, optimizations to get more cache hits
# implies that __DATE__ and __TIME__ are not critical for functionality.
# Ignore include file modification time since it will depend on when
# the repo was checked out
export CCACHE_SLOPPINESS := time_macros,include_file_mtime,file_macro
# Turn all preprocessor absolute paths into relative paths.
# Fixes absolute paths in preprocessed source due to use of -g.
# We don't really use system headers much so the rootdir is
# fine; ensures these paths are relative for all Android trees
# on a workstation.
export CCACHE_BASEDIR := /
CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG)
# If we are cross-compiling Windows binaries on Linux
# then use the linux ccache binary instead.