summaryrefslogtreecommitdiffstats
path: root/build/config/features.gni
blob: 27906ec6c0e4c91a53cdbced5ebf4bca2b74d6e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This file contains Chrome-feature-related build flags (see ui.gni for
# UI-related ones). These should theoretically be moved to the build files of
# the features themselves.
#
# However, today we have many "bad" dependencies on some of these flags from,
# e.g. base, so they need to be global to match the GYP configuration. Also,
# anything that needs a grit define must be in either this file or ui.gni.
#
# PLEASE TRY TO AVOID ADDING FLAGS TO THIS FILE in cases where grit isn't
# required. See the declare_args block of BUILDCONFIG.gn for advice on how
# to set up feature flags.

import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/headless_build.gni")
if (is_android) {
  import("//build/config/android/config.gni")
}

declare_args() {
  # Multicast DNS.
  enable_mdns = is_win || is_linux

  enable_extensions = !is_android && !is_ios
  enable_plugins = (!is_android && !is_ios) || is_chromecast
  enable_pdf = !is_android && !is_ios && !is_chromecast

  # Enables Native Client support.
  # TODO(mcgrathr): When mipsel-nacl-clang is available, drop the exclusion.
  enable_nacl =
      !is_ios && !is_android && !is_chromecast && current_cpu != "mipsel"

  # If debug_devtools is set to true, JavaScript files for DevTools are stored
  # as is and loaded from disk. Otherwise, a concatenated file is stored in
  # resources.pak. It is still possible to load JS files from disk by passing
  # --debug-devtools cmdline switch.
  debug_devtools = false

  # Enables WebRTC.
  enable_webrtc = !is_ios

  # Enables the Media Router.
  enable_media_router = !is_ios

  # Enables proprietary codecs and demuxers; e.g. H264, AAC, MP3, and MP4.
  # We always build Google Chrome and Chromecast with proprietary codecs.
  proprietary_codecs = is_chrome_branded || is_chromecast

  enable_configuration_policy = !is_ios

  enable_captive_portal_detection = !is_android && !is_ios

  # Enables use of the session service, which is enabled by default.
  # Android stores them separately on the Java side.
  enable_session_service = !is_android && !is_ios

  enable_plugin_installation = is_win || is_mac

  enable_app_list = !is_ios && !is_android

  enable_supervised_users = !is_ios

  enable_autofill_dialog = !is_ios

  enable_remoting = !is_ios && !is_chromecast && !is_headless

  # Enable hole punching for the protected video.
  enable_video_hole = is_android

  # Enables browser side Content Decryption Modules. Required for embedders
  # (e.g. Android and ChromeCast) that use a browser side CDM.
  enable_browser_cdms = is_android || is_chromecast

  # Hangout services is an extension that adds extra features to Hangouts.
  # For official GYP builds, this flag is set.
  enable_hangout_services_extension = false

  # Variable safe_browsing is used to control the build time configuration for
  # safe browsing feature. Safe browsing can be compiled in 3 different levels:
  # 0 disables it, 1 enables it fully, and 2 enables mobile protection via an
  # external API.
  if (is_android) {
    safe_browsing_mode = 2
  } else if (is_ios) {
    safe_browsing_mode = 0
  } else {
    safe_browsing_mode = 1
  }

  # Set to true make a build that disables activation of field trial tests
  # specified in testing/variations/fieldtrial_testing_config_*.json.
  # Note: this setting is ignored if is_chrome_branded.
  fieldtrial_testing_like_official_build = is_chrome_branded

  use_cups = (is_desktop_linux || is_mac) && !is_chromecast && !is_headless

  # Enables Wi-Fi Display functionality
  # WARNING: This enables MPEG Transport Stream (MPEG-TS) encoding!
  enable_wifi_display = false
}

# Additional dependent variables -----------------------------------------------

# Set the version of CLD.
#   1: (DEPRECATED! See http://crbug.com/528305 for info) Use only CLD1.
#   2: Use only CLD2.
cld_version = 2

# libudev usage. This currently only affects the content layer.
use_udev = is_linux && !is_chromecast && !is_headless

# Enable the spell checker.
enable_spellcheck = !is_ios

# Use the operating system's spellchecker rather than hunspell.
use_browser_spellchecker = is_android || is_mac

# Enable basic printing support and UI.
enable_basic_printing =
    !is_chromeos && !is_chromecast && !is_ios && !is_headless

# Enable printing with print preview. It does not imply
# enable_basic_printing. It's possible to build Chrome with preview only.
enable_print_preview = !is_android && !is_chromecast && !is_ios && !is_headless

# Enables the use of CDMs in pepper plugins.
enable_pepper_cdms =
    enable_plugins && (is_linux || is_mac || is_win) && !is_chromecast

# The seccomp-bpf sandbox is only supported on five architectures
# currently.
# Do not disable seccomp_bpf anywhere without talking to
# security@chromium.org!
use_seccomp_bpf =
    (is_linux || is_android) &&
    (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
     current_cpu == "arm64" || current_cpu == "mipsel")

# Enable notifications everywhere except iOS.
enable_notifications = !is_ios

enable_web_speech = !is_android && !is_ios

use_dbus = is_linux && !is_chromecast && !is_headless

enable_task_manager = !is_ios && !is_android

enable_themes = !is_android && !is_ios

# Whether we are using the rlz library or not.  Platforms like Android send
# rlz codes for searches but do not use the library.
enable_rlz_support = is_win || is_mac || is_ios || is_chromeos
enable_rlz = is_chrome_branded && enable_rlz_support

enable_settings_app = enable_app_list && !is_chromeos

enable_service_discovery = enable_mdns || is_mac

# Image loader extension is enabled on ChromeOS only.
enable_image_loader_extension = is_chromeos

# Chrome OS: whether to also build the upcoming version of
# ChromeVox, which can then be enabled via a command-line switch.
enable_chromevox_next = false

# Use brlapi from brltty for braille display support.
use_brlapi = is_chromeos

# Option controlling the use of GConf (the classic GNOME configuration
# system).
use_gconf = is_linux && !is_chromeos && !is_chromecast && !is_headless

# Enable WebVR support by default on Android
# Still requires command line flag to access API
enable_webvr = is_android

use_gio = is_linux && !is_chromeos && !is_chromecast && !is_headless