xref: /aosp_15_r20/external/cronet/build/config/chromeos/ui_mode.gni (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2020 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/config/chromeos/args.gni")
6
7declare_args() {
8  # Deprecated, use is_chromeos_lacros.
9  #
10  # This controls UI configuration for Chrome.
11  # If this flag is set, we assume Chrome runs on Chrome OS devices, using
12  # Wayland (instead of X11).
13  #
14  # TODO(crbug.com/1052397):
15  # Define chromeos_product instead, which takes either "browser" or "ash".
16  # Re-define the following variables as:
17  # is_chromeos_lacros = chromeos_product == "browser"
18  # is_chromeos_ash = chromeos_product == "ash"
19  chromeos_is_browser_only = false
20
21  # Setting this to true when building linux Lacros-chrome will cause it to
22  # *also* build linux ash-chrome in a subdirectory using an alternate
23  # toolchain.
24  # Don't set this unless you're sure you want it, because it'll double
25  # your build time.
26  also_build_ash_chrome = false
27
28  # Setting this to true when building linux ash-chrome will cause it to
29  # *also* build linux Lacros-chrome in a subdirectory using an alternate toolchain.
30  also_build_lacros_chrome = false
31
32  # Setting this when building ash-chrome will cause it to
33  # *also* build Lacros-chrome in a subdirectory using an alternate toolchain.
34  # You can set this to either "amd64" or "arm".
35  also_build_lacros_chrome_for_architecture = ""
36}
37
38# is_chromeos_{ash,lacros} is used to specify that it is specific to either
39# ash or lacros chrome for chromeos. For platform specific logic that
40# applies to both, use is_chromeos instead.
41# .gn files are evaluated multiple times for each toolchain.
42# is_chromeos_{ash,lacros} should be set true only for builds with target
43# toolchains.
44is_chromeos_ash = is_chromeos && !chromeos_is_browser_only
45is_chromeos_lacros = is_chromeos && chromeos_is_browser_only
46
47# also_build_ash_chrome and also_build_lacros_chrome cannot be both true.
48assert(!(also_build_ash_chrome && also_build_lacros_chrome))
49
50# Can't set both also_build_lacros_chrome and
51# also_build_lacros_chrome_for_architecture.
52assert(!(also_build_lacros_chrome == true &&
53             also_build_lacros_chrome_for_architecture != ""))
54
55# also_build_lacros_chrome_for_architecture is for device only.
56assert(is_chromeos_device || also_build_lacros_chrome_for_architecture == "")
57
58# also_build_lacros_chrome_for_architecture is for ash build only.
59assert(!chromeos_is_browser_only ||
60       also_build_lacros_chrome_for_architecture == "")
61