1*8975f5c5SAndroid Build Coastguard Worker# Copyright 2014 The Chromium Authors 2*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be 3*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file. 4*8975f5c5SAndroid Build Coastguard Worker 5*8975f5c5SAndroid Build Coastguard Workerimport("//build/toolchain/rbe.gni") 6*8975f5c5SAndroid Build Coastguard Worker 7*8975f5c5SAndroid Build Coastguard Worker# Defines the configuration of cc wrapper 8*8975f5c5SAndroid Build Coastguard Worker# ccache, sccache: c/c++ compiler caches which can greatly reduce recompilation 9*8975f5c5SAndroid Build Coastguard Worker# times. 10*8975f5c5SAndroid Build Coastguard Worker# icecc, distcc: it takes compile jobs from a build and distributes them among 11*8975f5c5SAndroid Build Coastguard Worker# remote machines allowing a parallel build. 12*8975f5c5SAndroid Build Coastguard Worker# 13*8975f5c5SAndroid Build Coastguard Worker# TIPS 14*8975f5c5SAndroid Build Coastguard Worker# 15*8975f5c5SAndroid Build Coastguard Worker# 1) ccache 16*8975f5c5SAndroid Build Coastguard Worker# Set clang_use_chrome_plugins=false if using ccache 3.1.9 or earlier, since 17*8975f5c5SAndroid Build Coastguard Worker# these versions don't support -Xclang. (3.1.10 and later will silently 18*8975f5c5SAndroid Build Coastguard Worker# ignore -Xclang, so it doesn't matter if you disable clang_use_chrome_plugins 19*8975f5c5SAndroid Build Coastguard Worker# or not). 20*8975f5c5SAndroid Build Coastguard Worker# 21*8975f5c5SAndroid Build Coastguard Worker# Use ccache 3.2 or later to avoid clang unused argument warnings: 22*8975f5c5SAndroid Build Coastguard Worker# https://bugzilla.samba.org/show_bug.cgi?id=8118 23*8975f5c5SAndroid Build Coastguard Worker# 24*8975f5c5SAndroid Build Coastguard Worker# 2) icecc 25*8975f5c5SAndroid Build Coastguard Worker# Set clang_use_chrome_plugins=false because icecc cannot distribute custom 26*8975f5c5SAndroid Build Coastguard Worker# clang libraries. 27*8975f5c5SAndroid Build Coastguard Worker# 28*8975f5c5SAndroid Build Coastguard Worker# To use icecc and ccache together, set cc_wrapper = "ccache" with 29*8975f5c5SAndroid Build Coastguard Worker# export CCACHE_PREFIX=icecc 30*8975f5c5SAndroid Build Coastguard Worker 31*8975f5c5SAndroid Build Coastguard Workerdeclare_args() { 32*8975f5c5SAndroid Build Coastguard Worker # Set to "ccache", "sccache", "icecc" or "distcc". 33*8975f5c5SAndroid Build Coastguard Worker cc_wrapper = "" 34*8975f5c5SAndroid Build Coastguard Worker} 35*8975f5c5SAndroid Build Coastguard Worker 36*8975f5c5SAndroid Build Coastguard Workerassert(!use_remoteexec || cc_wrapper == "", 37*8975f5c5SAndroid Build Coastguard Worker "use_remoteexec and cc_wrapper can not be used together.") 38