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