cc_wrapper.gni 1.5 KB

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