Commit 0a9e4ca5 authored by cmasone's avatar cmasone Committed by Commit bot

GN: Move configs for single-use Linux packages close to usage

Several configs in the Linux GN build are used in only one place.
Defining these configs in build/config/linux/BUILD.gn makes them
get resolved on all Linux-derived platforms, during both target
builds and host-tool builds. This doesn't work on CrOS, which
does not need or want the packages references by these configs.

gconf is used in multiple places, so moving the config won't work.
Instead, the gconf config is only resolved when building for
a Linux target.

BUG=None
TEST=GN build for Linux and CrOS
R=jamesr

Review URL: https://codereview.chromium.org/655343002

Cr-Commit-Position: refs/heads/master@{#299903}
parent aa0b30fe
...@@ -118,23 +118,15 @@ config("libresolv") { ...@@ -118,23 +118,15 @@ config("libresolv") {
# CrOS doesn't install GTK, gconf or any gnome packages. # CrOS doesn't install GTK, gconf or any gnome packages.
if (!is_chromeos) { if (!is_chromeos) {
pkg_config("gtk") { # These packages should _only_ be expected when building for a target.
# Gtk requires gmodule, but it does not list it as a dependency in some # If these extra checks are not run, gconf is required when building host
# misconfigured systems. # tools for a CrOS build.
packages = [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ] if (current_toolchain == host_toolchain &&
} host_toolchain == default_toolchain) {
pkg_config("gconf") {
pkg_config("gtkprint") { packages = [ "gconf-2.0" ]
packages = [ "gtk+-unix-print-2.0" ] defines = [ "USE_GCONF" ]
} }
pkg_config("gnome_keyring") {
packages = [ "gnome-keyring-1" ]
}
pkg_config("gconf") {
packages = [ "gconf-2.0" ]
defines = [ "USE_GCONF" ]
} }
} }
......
...@@ -13,6 +13,9 @@ if (is_android) { ...@@ -13,6 +13,9 @@ if (is_android) {
} else { } else {
import("//tools/grit/grit_rule.gni") import("//tools/grit/grit_rule.gni")
} }
if (is_desktop_linux) {
import("//build/config/linux/pkg_config.gni")
}
about_credits_file = "$target_gen_dir/about_credits.html" about_credits_file = "$target_gen_dir/about_credits.html"
additional_modules_list_file = additional_modules_list_file =
...@@ -24,6 +27,12 @@ gypi_values = exec_script( ...@@ -24,6 +27,12 @@ gypi_values = exec_script(
"scope", "scope",
[ "../chrome_browser.gypi" ]) [ "../chrome_browser.gypi" ])
if (is_desktop_linux) {
pkg_config("gnome_keyring") {
packages = [ "gnome-keyring-1" ]
}
}
static_library("browser") { static_library("browser") {
configs += [ configs += [
"//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wexit_time_destructors",
...@@ -371,7 +380,7 @@ static_library("browser") { ...@@ -371,7 +380,7 @@ static_library("browser") {
if (is_desktop_linux) { if (is_desktop_linux) {
sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources, sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources,
".", "//chrome") ".", "//chrome")
configs += [ "//build/config/linux:gnome_keyring" ] configs += [ ":gnome_keyring" ]
} }
if (use_aura) { if (use_aura) {
sources += rebase_path(gypi_values.chrome_browser_aura_sources, sources += rebase_path(gypi_values.chrome_browser_aura_sources,
......
...@@ -5,6 +5,17 @@ ...@@ -5,6 +5,17 @@
assert(is_linux, "This file should only be referenced on Linux") assert(is_linux, "This file should only be referenced on Linux")
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/linux/pkg_config.gni")
pkg_config("gtk") {
# Gtk requires gmodule, but it does not list it as a dependency in some
# misconfigured systems.
packages = [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ]
}
pkg_config("gtkprint") {
packages = [ "gtk+-unix-print-2.0" ]
}
component("libgtk2ui") { component("libgtk2ui") {
sources = [ sources = [
...@@ -70,9 +81,9 @@ component("libgtk2ui") { ...@@ -70,9 +81,9 @@ component("libgtk2ui") {
defines = [ "LIBGTK2UI_IMPLEMENTATION" ] defines = [ "LIBGTK2UI_IMPLEMENTATION" ]
configs += [ configs += [
":gtk",
":gtkprint",
"//build/config/linux:gconf", "//build/config/linux:gconf",
"//build/config/linux:gtk",
"//build/config/linux:gtkprint",
"//printing:cups", "//printing:cups",
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment