Commit 667c433e authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

ozone/wayland: Change the way how we link with wayland-egl/client.

We used to be linking with system provided libwayland-egl,
but it's not suitable for our script that controls required packages.

The thing is that libwayland-egl1 is available on Debian => 9
and Ubuntu >= 16. On older versions (Trusty and Jessie),
libwayland-egl0 is available. We don't support different packages
for different versions. Thus, use the wayland-egl from
the //third_party.

And there is also another problem with libwayland-client. When
we statically link with the library from
//third_party/wayland:wayland_client, libffi dependency is also added.
However, Ubuntu 20 names this package libffi7, while older versions
name that as libffi6. Thus, to avoid this problem, link with
that package differently through libs = [ "wayland-client" ].

Bug: 1116384
Change-Id: I76f7205db0d6425e92bd66c7b1981d525f49d2e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2355944Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#798772}
parent 13c4cc44
......@@ -19,9 +19,9 @@ if (!use_system_libwayland) {
static_library("wayland_util") {
sources = [
"src/src/wayland-private.h",
"src/src/wayland-util.c",
"src/src/wayland-util.h",
"src/src/wayland-private.h",
]
configs -= [ "//build/config/compiler:chromium_code" ]
......@@ -102,6 +102,22 @@ if (!use_system_libwayland) {
public_configs = [ ":wayland_config" ]
}
static_library("wayland_egl") {
sources = [
"src/egl/wayland-egl-backend.h",
"src/egl/wayland-egl-core.h",
"src/egl/wayland-egl.c",
"src/egl/wayland-egl.h",
]
deps = [ ":wayland_util" ]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":wayland_config" ]
}
config("wayland_scanner_config") {
cflags = [
"-Wno-int-conversion",
......@@ -137,6 +153,10 @@ if (use_system_libwayland) {
packages = [ "wayland-server" ]
}
pkg_config("wayland_egl_config") {
packages = [ "wayland-egl" ]
}
group("wayland_client") {
public_configs = [ ":wayland_client_config" ]
}
......@@ -148,4 +168,8 @@ if (use_system_libwayland) {
group("wayland_util") {
public_configs = [ ":wayland_client_config" ]
}
group("wayland_egl") {
public_configs = [ ":wayland_egl_config" ]
}
}
......@@ -10,10 +10,6 @@ import("//gpu/vulkan/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//ui/ozone/platform/wayland/wayland.gni")
pkg_config("wayland-egl") {
packages = [ "wayland-egl" ]
}
source_set("wayland") {
sources = [
"client_native_pixmap_factory_wayland.cc",
......@@ -150,7 +146,7 @@ source_set("wayland") {
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland:wayland_egl",
"//third_party/wayland-protocols:gtk_primary_selection_protocol",
"//third_party/wayland-protocols:keyboard_extension_protocol",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
......@@ -182,6 +178,18 @@ source_set("wayland") {
"//ui/platform_window/wm",
]
# TODO(msisov): we should do the following once support for Trusty and Jessie
# are dropped:
# 1. Remove libs=["wayland-client"] and
# add deps+=["//third_party/wayland:wayland_client"]
# 2. Set use_system_libwayland=true for is_desktop_linux.
libs = []
if (!is_chromeos) {
libs = [ "wayland-client" ]
} else {
deps += [ "//third_party/wayland:wayland_client" ]
}
if (is_linux && !is_chromeos) {
deps += [ "//ui/base/ime/linux" ]
}
......@@ -229,10 +237,7 @@ source_set("wayland") {
deps += [ "//gpu/vulkan" ]
}
configs += [
":wayland-egl",
"//third_party/khronos:khronos_headers",
]
configs += [ "//third_party/khronos:khronos_headers" ]
}
source_set("test_support") {
......
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