blob: d10aceb01cdf709f11bc188d00ac1960814d18e5 [file] [log] [blame]
Ying Wang57d90602015-07-20 18:40:18 -07001#
2# Copyright (C) 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Dan Willemsen75567032018-04-05 15:25:59 -070017# We no longer provide a ccache prebuilt.
18#
19# Ours was old, and had a number of issues that triggered non-reproducible
20# results and other failures. Newer ccache versions may fix some of those
21# issues, but at the large scale of our build servers, we weren't seeing
22# significant performance gains from using ccache -- you end up needing very
23# good locality and/or very large caches if you're building many different
24# configurations.
25#
26# Local no-change full rebuilds were showing better results, but why not just
27# use incremental builds at that point?
28#
29# So if you still want to use ccache, continue setting USE_CCACHE, but also set
30# the CCACHE_EXEC environment variable to the path to your ccache executable.
31ifneq ($(CCACHE_EXEC),)
Shinichiro Hamajid78cba12015-12-18 15:26:17 +090032ifneq ($(filter-out false,$(USE_CCACHE)),)
Ying Wang57d90602015-07-20 18:40:18 -070033 # The default check uses size and modification time, causing false misses
34 # since the mtime depends when the repo was checked out
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -080035 CCACHE_COMPILERCHECK ?= content
Ying Wang57d90602015-07-20 18:40:18 -070036
37 # See man page, optimizations to get more cache hits
38 # implies that __DATE__ and __TIME__ are not critical for functionality.
39 # Ignore include file modification time since it will depend on when
40 # the repo was checked out
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -080041 CCACHE_SLOPPINESS := time_macros,include_file_mtime,file_macro
Ying Wang57d90602015-07-20 18:40:18 -070042
43 # Turn all preprocessor absolute paths into relative paths.
44 # Fixes absolute paths in preprocessed source due to use of -g.
45 # We don't really use system headers much so the rootdir is
46 # fine; ensures these paths are relative for all Android trees
47 # on a workstation.
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -080048 CCACHE_BASEDIR := /
Ying Wang57d90602015-07-20 18:40:18 -070049
50 # Workaround for ccache with clang.
51 # See http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -080052 CCACHE_CPP2 := true
Ying Wang57d90602015-07-20 18:40:18 -070053
Dan Willemsen75567032018-04-05 15:25:59 -070054 ifndef CC_WRAPPER
55 CC_WRAPPER := $(CCACHE_EXEC)
Ying Wang57d90602015-07-20 18:40:18 -070056 endif
Dan Willemsen75567032018-04-05 15:25:59 -070057 ifndef CXX_WRAPPER
58 CXX_WRAPPER := $(CCACHE_EXEC)
59 endif
60endif
Ying Wang57d90602015-07-20 18:40:18 -070061endif