xref: /aosp_15_r20/external/angle/build/config/chrome_build.gni (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker# Copyright 2015 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 Workerdeclare_args() {
6*8975f5c5SAndroid Build Coastguard Worker  # Select the desired branding flavor. False means normal Chromium branding,
7*8975f5c5SAndroid Build Coastguard Worker  # true means official Google Chrome branding (requires extra Google-internal
8*8975f5c5SAndroid Build Coastguard Worker  # resources).
9*8975f5c5SAndroid Build Coastguard Worker  is_chrome_branded = false
10*8975f5c5SAndroid Build Coastguard Worker
11*8975f5c5SAndroid Build Coastguard Worker  # Whether to enable the Chrome for Testing (CfT) flavor. This arg is not
12*8975f5c5SAndroid Build Coastguard Worker  # compatible with `is_chrome_branded`.
13*8975f5c5SAndroid Build Coastguard Worker  #
14*8975f5c5SAndroid Build Coastguard Worker  # Design document: https://goo.gle/chrome-for-testing
15*8975f5c5SAndroid Build Coastguard Worker  is_chrome_for_testing = false
16*8975f5c5SAndroid Build Coastguard Worker
17*8975f5c5SAndroid Build Coastguard Worker  # Whether to use internal Chrome for Testing (CfT).
18*8975f5c5SAndroid Build Coastguard Worker  # Requires `src-internal/` and `is_chrome_for_testing = true`.
19*8975f5c5SAndroid Build Coastguard Worker  #
20*8975f5c5SAndroid Build Coastguard Worker  # When true, use Google-internal icons, otherwise fall back to Chromium icons.
21*8975f5c5SAndroid Build Coastguard Worker  is_chrome_for_testing_branded = false
22*8975f5c5SAndroid Build Coastguard Worker
23*8975f5c5SAndroid Build Coastguard Worker  # Set to true to enable settings for high end Android devices, typically
24*8975f5c5SAndroid Build Coastguard Worker  # enhancing speed at the expense of resources such as binary sizes and memory.
25*8975f5c5SAndroid Build Coastguard Worker  is_high_end_android = target_cpu == "arm64" || target_cpu == "x64"
26*8975f5c5SAndroid Build Coastguard Worker
27*8975f5c5SAndroid Build Coastguard Worker  # Set to true to set defaults that enable features on Android that are more
28*8975f5c5SAndroid Build Coastguard Worker  # typically available on desktop.
29*8975f5c5SAndroid Build Coastguard Worker  is_desktop_android = false
30*8975f5c5SAndroid Build Coastguard Worker
31*8975f5c5SAndroid Build Coastguard Worker  if (is_android) {
32*8975f5c5SAndroid Build Coastguard Worker    # By default, Trichrome channels are compiled using separate package names.
33*8975f5c5SAndroid Build Coastguard Worker    # Set this to 'true' to compile Trichrome channels using the Stable channel's
34*8975f5c5SAndroid Build Coastguard Worker    # package name. This currently only affects builds with `android_channel =
35*8975f5c5SAndroid Build Coastguard Worker    # "beta"`.
36*8975f5c5SAndroid Build Coastguard Worker    use_stable_package_name_for_trichrome = false
37*8975f5c5SAndroid Build Coastguard Worker  }
38*8975f5c5SAndroid Build Coastguard Worker}
39*8975f5c5SAndroid Build Coastguard Worker
40*8975f5c5SAndroid Build Coastguard Worker# Ensure !is_android implies !is_high_end_android.
41*8975f5c5SAndroid Build Coastguard Workeris_high_end_android = is_high_end_android && is_android
42*8975f5c5SAndroid Build Coastguard Worker
43*8975f5c5SAndroid Build Coastguard Workerif (is_desktop_android) {
44*8975f5c5SAndroid Build Coastguard Worker  assert(target_os == "android",
45*8975f5c5SAndroid Build Coastguard Worker         "Target must be Android to use is_desktop_android.")
46*8975f5c5SAndroid Build Coastguard Worker
47*8975f5c5SAndroid Build Coastguard Worker  # Disable for non-android secondary toolchains.
48*8975f5c5SAndroid Build Coastguard Worker  is_desktop_android = is_android
49*8975f5c5SAndroid Build Coastguard Worker}
50*8975f5c5SAndroid Build Coastguard Worker
51*8975f5c5SAndroid Build Coastguard Workerdeclare_args() {
52*8975f5c5SAndroid Build Coastguard Worker  # Whether to apply size->speed trade-offs to the secondary toolchain.
53*8975f5c5SAndroid Build Coastguard Worker  # Relevant only for 64-bit target_cpu.
54*8975f5c5SAndroid Build Coastguard Worker  is_high_end_android_secondary_toolchain = false
55*8975f5c5SAndroid Build Coastguard Worker}
56*8975f5c5SAndroid Build Coastguard Worker
57*8975f5c5SAndroid Build Coastguard Workerassert(!is_chrome_for_testing || !is_chrome_branded,
58*8975f5c5SAndroid Build Coastguard Worker       "`is_chrome_for_testing` is incompatible with `is_chrome_branded`")
59*8975f5c5SAndroid Build Coastguard Worker
60*8975f5c5SAndroid Build Coastguard Workerassert(is_chrome_for_testing || !is_chrome_for_testing_branded,
61*8975f5c5SAndroid Build Coastguard Worker       "`is_chrome_for_testing_branded` requires `is_chrome_for_testing`")
62*8975f5c5SAndroid Build Coastguard Worker
63*8975f5c5SAndroid Build Coastguard Workerdeclare_args() {
64*8975f5c5SAndroid Build Coastguard Worker  # Refers to the subdirectory for branding in various places including
65*8975f5c5SAndroid Build Coastguard Worker  # chrome/app/theme.
66*8975f5c5SAndroid Build Coastguard Worker  #
67*8975f5c5SAndroid Build Coastguard Worker  # `branding_path_product` must not contain slashes.
68*8975f5c5SAndroid Build Coastguard Worker  if (is_chrome_for_testing) {
69*8975f5c5SAndroid Build Coastguard Worker    if (is_chrome_for_testing_branded) {
70*8975f5c5SAndroid Build Coastguard Worker      branding_path_component = "google_chrome/google_chrome_for_testing"
71*8975f5c5SAndroid Build Coastguard Worker    } else {
72*8975f5c5SAndroid Build Coastguard Worker      branding_path_component = "chromium"
73*8975f5c5SAndroid Build Coastguard Worker    }
74*8975f5c5SAndroid Build Coastguard Worker    branding_path_product = "chromium"
75*8975f5c5SAndroid Build Coastguard Worker  } else if (is_chrome_branded) {
76*8975f5c5SAndroid Build Coastguard Worker    branding_path_component = "google_chrome"
77*8975f5c5SAndroid Build Coastguard Worker    branding_path_product = "google_chrome"
78*8975f5c5SAndroid Build Coastguard Worker  } else {
79*8975f5c5SAndroid Build Coastguard Worker    branding_path_component = "chromium"
80*8975f5c5SAndroid Build Coastguard Worker    branding_path_product = "chromium"
81*8975f5c5SAndroid Build Coastguard Worker  }
82*8975f5c5SAndroid Build Coastguard Worker}
83*8975f5c5SAndroid Build Coastguard Worker
84*8975f5c5SAndroid Build Coastguard Workerdeclare_args() {
85*8975f5c5SAndroid Build Coastguard Worker  # The path to the BRANDING file in chrome/app/theme.
86*8975f5c5SAndroid Build Coastguard Worker  branding_file_path = "//chrome/app/theme/$branding_path_component/BRANDING"
87*8975f5c5SAndroid Build Coastguard Worker}
88