Linux: Add cef_use_gtk GN variable to optionally disable GTK configuration.

GTK is required to build the cefclient sample application but is not otherwise
required by CEF. This option allows builders to avoid configuring GTK when
building outside of the sysroot environment (with use_sysroot=false). It defaults to false when building inside the sysroot environment.
This commit is contained in:
Thomas Preston 2019-11-05 21:12:20 +00:00 committed by Marshall Greenblatt
parent c8d0813669
commit 04c9bcd802

View File

@ -235,6 +235,13 @@ if (is_win) {
import("//build/config/win/manifest.gni")
}
declare_args() {
# The cefclient target depends on GTK packages that are not available in the
# default sysroot environment. So we should only use them when we are not
# using the sysroot. Alternatively, the developer might not want to use the
# GTK dependencies at all, in which case they can set `cef_use_gtk=false`.
cef_use_gtk = !use_sysroot
}
#
# Verify required global arguments configured via `gn args`.
@ -2055,7 +2062,9 @@ if (is_mac) {
"glib-2.0",
]
}
}
if (is_linux && cef_use_gtk) {
pkg_config("gtk") {
packages = [
"gmodule-2.0",
@ -2149,7 +2158,7 @@ if (is_mac) {
"X11",
]
if (!use_sysroot) {
if (cef_use_gtk) {
configs += [
":gtk",
":gtkglext",