xref: /aosp_15_r20/external/cronet/build/toolchain/goma.gni (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2013 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
5# Defines the configuration of Goma.
6
7import("//build/toolchain/siso.gni")
8
9declare_args() {
10  # Set to true to enable distributed compilation using Goma.
11  use_goma = false
12
13  # Absolute directory containing the gomacc binary.
14  goma_dir = ""
15}
16
17if (use_goma && goma_dir == "") {
18  goma_dir = exec_script("get_goma_dir.py", [], "string")
19}
20
21assert(!is_win || !use_goma || is_clang,
22       "cl.exe does not work on goma, use clang")
23
24# TODO(b/41489832): remove this after goma shutdown.
25assert(
26    !use_goma || target_os == "chromeos",
27    "use_goma can only be used for ChromeOS build now." +
28        " Use use_remoteexec=true instead for other build." +
29        " See build instructions from " + "https://source.chromium.org/search?q=%22Use%20Reclient%22&ss=chromium%2Fchromium%2Fsrc:docs%2F")
30
31if (use_goma && current_toolchain == default_toolchain) {
32  if (host_os == "win") {
33    print("The gn arg use_goma=true will be deprecated by EOY 2023. " +
34          "Please use `use_remoteexec=true` instead. See " +
35          "https://chromium.googlesource.com/chromium/src/+/main/docs/" +
36          "windows_build_instructions.md#use-reclient " +
37          "for setup instructions.")
38  } else if (host_os == "mac") {
39    print("The gn arg use_goma=true will be deprecated by EOY 2023. " +
40          "Please use `use_remoteexec=true` instead. " +
41          "If you are a googler see http://go/building-chrome-mac" +
42          "#using-remote-execution for setup instructions.")
43  } else {
44    print("The gn arg use_goma=true will be deprecated by EOY 2023. " +
45          "Please use `use_remoteexec=true` instead. See " +
46          "https://chromium.googlesource.com/chromium/src/+/main/docs/" +
47          "linux/build_instructions.md#use-reclient for setup instructions.")
48  }
49  assert(!use_siso,
50         "Siso does not support Goma. Use use_remoteexec=true instead.")
51}
52