1# Copyright (c) 2014 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5# Defines the configuration of cc wrapper 6# ccache: a c/c++ compiler cache which can greatly reduce recompilation times. 7# icecc, distcc: it takes compile jobs from a build and distributes them among 8# remote machines allowing a parallel build. 9# 10# TIPS 11# 12# 1) ccache 13# Set clang_use_chrome_plugins=false if using ccache 3.1.9 or earlier, since 14# these versions don't support -Xclang. (3.1.10 and later will silently 15# ignore -Xclang, so it doesn't matter if you disable clang_use_chrome_plugins 16# or not). 17# 18# Use ccache 3.2 or later to avoid clang unused argument warnings: 19# https://bugzilla.samba.org/show_bug.cgi?id=8118 20# 21# To avoid -Wparentheses-equality clang warnings, at some cost in terms of 22# speed, you can do: 23# export CCACHE_CPP2=yes 24# 25# 2) icecc 26# Set clang_use_chrome_plugins=false because icecc cannot distribute custom 27# clang libraries. 28# 29# To use icecc and ccache together, set cc_wrapper = "ccache" with 30# export CCACHE_PREFIX=icecc 31 32_cc_wrapper = "" 33_ccache_exec = getenv("CCACHE_EXEC") 34_use_ccache = getenv("USE_CCACHE") 35_xcache_exec = getenv("XCACHE_EXEC") 36_use_xcache = getenv("USE_XCACHE") 37if (_use_ccache == "1" && _ccache_exec != "") { 38 _cc_wrapper = rebase_path(_ccache_exec) 39} else if (_use_xcache == "1" && _xcache_exec != "") { 40 _cc_wrapper = rebase_path(_xcache_exec) 41} 42 43declare_args() { 44 # Set to "ccache", "icecc" or "distcc". Probably doesn't work on windows. 45 cc_wrapper = _cc_wrapper 46} 47