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