summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorskyostil <skyostil@chromium.org>2015-11-11 08:24:25 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-11 16:24:57 +0000
commita557457caccb3c0f60e5d35ccc8c55af5849d76a (patch)
tree03e2197f713626b050ed9ff0270780a09ee27aa8 /build
parent43d2d6b6853ee7f58e6effa53891c5ec999d6a62 (diff)
downloadchromium_src-a557457caccb3c0f60e5d35ccc8c55af5849d76a.zip
chromium_src-a557457caccb3c0f60e5d35ccc8c55af5849d76a.tar.gz
chromium_src-a557457caccb3c0f60e5d35ccc8c55af5849d76a.tar.bz2
headless: Add gn setting headless mode
The is_headless setting configures the build in the same way as the embedded flag in gyp. Contributions by Alexander Timin <altimin@chromium.org> and Alex Clarke <alexclarke@chromium.org>. BUG=546953,318413 Review URL: https://codereview.chromium.org/1410883007 Cr-Commit-Position: refs/heads/master@{#359096}
Diffstat (limited to 'build')
-rw-r--r--build/config/features.gni18
-rw-r--r--build/config/headless_build.gni8
-rw-r--r--build/config/ui.gni5
-rw-r--r--build/linux/BUILD.gn2
4 files changed, 23 insertions, 10 deletions
diff --git a/build/config/features.gni b/build/config/features.gni
index e06daca..669ad5d 100644
--- a/build/config/features.gni
+++ b/build/config/features.gni
@@ -16,6 +16,7 @@
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")
}
@@ -86,7 +87,7 @@ declare_args() {
enable_one_click_signin = is_win || is_mac || (is_linux && !is_chromeos)
- enable_remoting = !is_ios && !is_android && !is_chromecast
+ enable_remoting = !is_ios && !is_android && !is_chromecast && !is_headless
# Enable hole punching for the protected video.
enable_video_hole = is_android
@@ -116,7 +117,7 @@ declare_args() {
# 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
+ use_cups = (is_desktop_linux || is_mac) && !is_chromecast && !is_headless
}
# Additional dependent variables -----------------------------------------------
@@ -127,7 +128,7 @@ declare_args() {
cld_version = 2
# libudev usage. This currently only affects the content layer.
-use_udev = is_linux && !is_chromecast
+use_udev = is_linux && !is_chromecast && !is_headless
# Enable the spell checker.
enable_spellcheck = !is_ios
@@ -136,11 +137,12 @@ enable_spellcheck = !is_ios
use_browser_spellchecker = is_android || is_mac
# Enable basic printing support and UI.
-enable_basic_printing = !is_chromeos && !is_chromecast && !is_ios
+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
+enable_print_preview = !is_android && !is_chromecast && !is_ios && !is_headless
# Enables the use of CDMs in pepper plugins.
enable_pepper_cdms =
@@ -159,7 +161,7 @@ enable_notifications = !is_ios
enable_web_speech = !is_android && !is_ios
-use_dbus = is_linux && !is_chromecast
+use_dbus = is_linux && !is_chromecast && !is_headless
enable_extensions = !is_android && !is_ios
@@ -191,7 +193,7 @@ use_brlapi = is_chromeos
# Option controlling the use of GConf (the classic GNOME configuration
# system).
-use_gconf = is_linux && !is_chromeos && !is_chromecast
+use_gconf = is_linux && !is_chromeos && !is_chromecast && !is_headless
# Whether to back up data before sync.
enable_pre_sync_backup = is_win || is_mac || (is_linux && !is_chromeos)
@@ -199,3 +201,5 @@ enable_pre_sync_backup = is_win || is_mac || (is_linux && !is_chromeos)
# Enable WebVR support by default on Android
# Still requires command line flag to access API
enable_webvr = is_android
+
+use_gio = is_desktop_linux && !is_headless
diff --git a/build/config/headless_build.gni b/build/config/headless_build.gni
new file mode 100644
index 0000000..1788b25
--- /dev/null
+++ b/build/config/headless_build.gni
@@ -0,0 +1,8 @@
+# Copyright 2015 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.
+
+declare_args() {
+ # Configure the build for headless mode. See crbug.com/546953.
+ is_headless = false
+}
diff --git a/build/config/ui.gni b/build/config/ui.gni
index e534366..3acf655 100644
--- a/build/config/ui.gni
+++ b/build/config/ui.gni
@@ -15,16 +15,17 @@
# to set up feature flags.
import("//build/config/chromecast_build.gni")
+import("//build/config/headless_build.gni")
declare_args() {
# Indicates if Ash is enabled. Ash is the Aura Shell which provides a
# desktop-like environment for Aura. Requires use_aura = true
- use_ash = (is_win || is_linux) && !is_chromecast
+ use_ash = (is_win || is_linux) && !is_chromecast && !is_headless
# Indicates if Ozone is enabled. Ozone is a low-level library layer for Linux
# that does not require X11. Enabling this feature disables use of glib, x11,
# Pango, and Cairo. Default to false on non-Chromecast builds.
- use_ozone = is_chromecast && !is_android
+ use_ozone = (is_chromecast || is_headless) && !is_android
# Indicates if Aura is enabled. Aura is a low-level windowing library, sort
# of a replacement for GDI or GTK.
diff --git a/build/linux/BUILD.gn b/build/linux/BUILD.gn
index 754859a..a66d86c 100644
--- a/build/linux/BUILD.gn
+++ b/build/linux/BUILD.gn
@@ -30,7 +30,7 @@ if (use_brlapi) {
functions = gypi_values.libbrlapi_functions
}
}
-if (is_desktop_linux) {
+if (use_gio) {
pkg_config("gio_config") {
packages = [ "gio-2.0" ]