From a557457caccb3c0f60e5d35ccc8c55af5849d76a Mon Sep 17 00:00:00 2001 From: skyostil Date: Wed, 11 Nov 2015 08:24:25 -0800 Subject: 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 and Alex Clarke . BUG=546953,318413 Review URL: https://codereview.chromium.org/1410883007 Cr-Commit-Position: refs/heads/master@{#359096} --- build/config/features.gni | 18 +++++++++++------- build/config/headless_build.gni | 8 ++++++++ build/config/ui.gni | 5 +++-- build/linux/BUILD.gn | 2 +- 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 build/config/headless_build.gni (limited to 'build') 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" ] -- cgit v1.1