| Ying Wang | 57d9060 | 2015-07-20 18:40:18 -0700 | [diff] [blame] | 1 | # | 
|  | 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 Willemsen | 7556703 | 2018-04-05 15:25:59 -0700 | [diff] [blame] | 17 | # 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. | 
|  | 31 | ifneq ($(CCACHE_EXEC),) | 
| Shinichiro Hamaji | d78cba1 | 2015-12-18 15:26:17 +0900 | [diff] [blame] | 32 | ifneq ($(filter-out false,$(USE_CCACHE)),) | 
| Ying Wang | 57d9060 | 2015-07-20 18:40:18 -0700 | [diff] [blame] | 33 | # The default check uses size and modification time, causing false misses | 
|  | 34 | # since the mtime depends when the repo was checked out | 
| Dan Willemsen | 8b9c3cc | 2018-02-27 02:15:32 -0800 | [diff] [blame] | 35 | CCACHE_COMPILERCHECK ?= content | 
| Ying Wang | 57d9060 | 2015-07-20 18:40:18 -0700 | [diff] [blame] | 36 |  | 
|  | 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 Willemsen | 8b9c3cc | 2018-02-27 02:15:32 -0800 | [diff] [blame] | 41 | CCACHE_SLOPPINESS := time_macros,include_file_mtime,file_macro | 
| Ying Wang | 57d9060 | 2015-07-20 18:40:18 -0700 | [diff] [blame] | 42 |  | 
|  | 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 Willemsen | 8b9c3cc | 2018-02-27 02:15:32 -0800 | [diff] [blame] | 48 | CCACHE_BASEDIR := / | 
| Ying Wang | 57d9060 | 2015-07-20 18:40:18 -0700 | [diff] [blame] | 49 |  | 
|  | 50 | # Workaround for ccache with clang. | 
|  | 51 | # See http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html | 
| Dan Willemsen | 8b9c3cc | 2018-02-27 02:15:32 -0800 | [diff] [blame] | 52 | CCACHE_CPP2 := true | 
| Ying Wang | 57d9060 | 2015-07-20 18:40:18 -0700 | [diff] [blame] | 53 |  | 
| Dan Willemsen | 7556703 | 2018-04-05 15:25:59 -0700 | [diff] [blame] | 54 | ifndef CC_WRAPPER | 
|  | 55 | CC_WRAPPER := $(CCACHE_EXEC) | 
| Ying Wang | 57d9060 | 2015-07-20 18:40:18 -0700 | [diff] [blame] | 56 | endif | 
| Dan Willemsen | 7556703 | 2018-04-05 15:25:59 -0700 | [diff] [blame] | 57 | ifndef CXX_WRAPPER | 
|  | 58 | CXX_WRAPPER := $(CCACHE_EXEC) | 
|  | 59 | endif | 
|  | 60 | endif | 
| Ying Wang | 57d9060 | 2015-07-20 18:40:18 -0700 | [diff] [blame] | 61 | endif |