2023-01-26 15:40:13 -05:00
|
|
|
# Copyright 2019 The ChromiumOS Authors
|
2019-09-20 18:57:28 -04:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2023-01-26 15:40:13 -05:00
|
|
|
import("//common-mk/pkg_config.gni")
|
2019-09-20 18:57:28 -04:00
|
|
|
import("wayland_protocol.gni")
|
|
|
|
|
|
|
|
group("all") {
|
2023-01-26 15:40:13 -05:00
|
|
|
deps = [ ":sommelier" ]
|
|
|
|
if (use.fuzzer) {
|
|
|
|
deps += [ ":sommelier_wayland_fuzzer" ]
|
2019-09-21 20:43:03 -04:00
|
|
|
}
|
2023-01-26 15:40:13 -05:00
|
|
|
|
|
|
|
if (use.test) {
|
|
|
|
deps += [ ":sommelier_test" ]
|
2019-09-21 20:43:03 -04:00
|
|
|
}
|
2019-09-20 18:57:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Set this to the Xwayland path.
|
|
|
|
if (!defined(xwayland_path)) {
|
|
|
|
xwayland_path = "\"/opt/google/cros-containers/bin/Xwayland\""
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set this to the GL driver path to use for Xwayland.
|
|
|
|
if (!defined(xwayland_gl_driver_path)) {
|
|
|
|
xwayland_gl_driver_path = "\"/opt/google/cros-containers/lib\""
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set this to the frame color to use for Xwayland clients.
|
|
|
|
if (!defined(frame_color)) {
|
|
|
|
frame_color = "\"#f2f2f2\""
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set this to the dark frame color to use for Xwayland clients.
|
|
|
|
if (!defined(dark_frame_color)) {
|
|
|
|
dark_frame_color = "\"#323639\""
|
|
|
|
}
|
|
|
|
|
|
|
|
wayland_protocol_library("sommelier-protocol") {
|
|
|
|
out_dir = "include"
|
|
|
|
sources = [
|
|
|
|
"protocol/aura-shell.xml",
|
|
|
|
"protocol/drm.xml",
|
2023-01-26 15:40:13 -05:00
|
|
|
"protocol/gaming-input-unstable-v2.xml",
|
2019-09-20 18:57:28 -04:00
|
|
|
"protocol/gtk-shell.xml",
|
|
|
|
"protocol/keyboard-extension-unstable-v1.xml",
|
|
|
|
"protocol/linux-dmabuf-unstable-v1.xml",
|
2023-01-26 15:40:13 -05:00
|
|
|
"protocol/linux-explicit-synchronization-unstable-v1.xml",
|
2019-09-21 20:43:03 -04:00
|
|
|
"protocol/pointer-constraints-unstable-v1.xml",
|
2019-09-20 18:57:28 -04:00
|
|
|
"protocol/relative-pointer-unstable-v1.xml",
|
2023-01-26 15:40:13 -05:00
|
|
|
"protocol/text-input-extension-unstable-v1.xml",
|
2019-09-20 18:57:28 -04:00
|
|
|
"protocol/text-input-unstable-v1.xml",
|
2023-01-26 15:40:13 -05:00
|
|
|
"protocol/text-input-x11-unstable-v1.xml",
|
2019-09-20 18:57:28 -04:00
|
|
|
"protocol/viewporter.xml",
|
2023-01-26 15:40:13 -05:00
|
|
|
"protocol/xdg-output-unstable-v1.xml",
|
|
|
|
"protocol/xdg-shell.xml",
|
2019-09-20 18:57:28 -04:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-01-26 15:40:13 -05:00
|
|
|
gaming_defines = [ "GAMEPAD_SUPPORT" ]
|
|
|
|
gaming_deps = [ ":libgaming" ]
|
|
|
|
|
|
|
|
tracing_defines = [ "PERFETTO_TRACING" ]
|
|
|
|
tracing_pkg_deps = [ "perfetto" ]
|
|
|
|
tracing_libs = [ "pthread" ]
|
|
|
|
|
|
|
|
sommelier_defines = [
|
|
|
|
"_GNU_SOURCE",
|
|
|
|
"WL_HIDE_DEPRECATED",
|
|
|
|
"XWAYLAND_PATH=${xwayland_path}",
|
|
|
|
"XWAYLAND_GL_DRIVER_PATH=${xwayland_gl_driver_path}",
|
|
|
|
"FRAME_COLOR=${frame_color}",
|
|
|
|
"DARK_FRAME_COLOR=${dark_frame_color}",
|
|
|
|
] + gaming_defines + tracing_defines
|
|
|
|
|
|
|
|
static_library("libgaming") {
|
|
|
|
sources = [ "sommelier-gaming.cc" ]
|
|
|
|
defines = gaming_defines
|
2019-09-20 18:57:28 -04:00
|
|
|
pkg_deps = [
|
2023-01-26 15:40:13 -05:00
|
|
|
"libevdev",
|
2019-09-20 18:57:28 -04:00
|
|
|
"pixman-1",
|
|
|
|
]
|
2023-01-26 15:40:13 -05:00
|
|
|
deps = [ ":sommelier-protocol" ]
|
2019-09-20 18:57:28 -04:00
|
|
|
}
|
|
|
|
|
2023-01-26 15:40:13 -05:00
|
|
|
static_library("libsommelier") {
|
2019-09-20 18:57:28 -04:00
|
|
|
sources = [
|
2023-01-26 15:40:13 -05:00
|
|
|
"compositor/sommelier-compositor.cc",
|
|
|
|
"compositor/sommelier-drm.cc",
|
|
|
|
"compositor/sommelier-mmap.cc",
|
|
|
|
"compositor/sommelier-shm.cc",
|
|
|
|
"sommelier-ctx.cc",
|
|
|
|
"sommelier-data-device-manager.cc",
|
|
|
|
"sommelier-display.cc",
|
|
|
|
"sommelier-global.cc",
|
|
|
|
"sommelier-gtk-shell.cc",
|
|
|
|
"sommelier-output.cc",
|
|
|
|
"sommelier-pointer-constraints.cc",
|
|
|
|
"sommelier-relative-pointer-manager.cc",
|
|
|
|
"sommelier-seat.cc",
|
|
|
|
"sommelier-shell.cc",
|
|
|
|
"sommelier-subcompositor.cc",
|
|
|
|
"sommelier-text-input.cc",
|
|
|
|
"sommelier-timing.cc",
|
|
|
|
"sommelier-tracing.cc",
|
|
|
|
"sommelier-transform.cc",
|
|
|
|
"sommelier-util.cc",
|
|
|
|
"sommelier-viewporter.cc",
|
|
|
|
"sommelier-window.cc",
|
|
|
|
"sommelier-xdg-shell.cc",
|
|
|
|
"sommelier-xshape.cc",
|
|
|
|
"sommelier.cc",
|
|
|
|
"virtualization/virtgpu_channel.cc",
|
|
|
|
"virtualization/virtwl_channel.cc",
|
2019-09-20 18:57:28 -04:00
|
|
|
]
|
2023-01-26 15:40:13 -05:00
|
|
|
include_dirs = []
|
|
|
|
defines = sommelier_defines
|
|
|
|
pkg_deps = [
|
|
|
|
"gbm",
|
|
|
|
"libdrm",
|
|
|
|
"pixman-1",
|
|
|
|
"wayland-client",
|
|
|
|
"wayland-server",
|
|
|
|
"xcb",
|
|
|
|
"xcb-composite",
|
|
|
|
"xcb-shape",
|
|
|
|
"xcb-xfixes",
|
|
|
|
"xkbcommon",
|
|
|
|
] + tracing_pkg_deps
|
|
|
|
libs = [ "m" ] + tracing_libs
|
|
|
|
deps = [ ":sommelier-protocol" ] + gaming_deps
|
2019-09-20 18:57:28 -04:00
|
|
|
}
|
|
|
|
|
2023-01-26 15:40:13 -05:00
|
|
|
executable("sommelier") {
|
|
|
|
sources = [ "sommelier-main.cc" ]
|
|
|
|
|
|
|
|
defines = sommelier_defines
|
|
|
|
|
|
|
|
deps = [ ":libsommelier" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (use.test) {
|
|
|
|
executable("sommelier_test") {
|
|
|
|
sources = [ "sommelier_test.cc" ]
|
|
|
|
|
|
|
|
pkg_deps = [ "pixman-1" ]
|
|
|
|
|
|
|
|
# gnlint: disable=GnLintCommonTesting
|
|
|
|
libs = [
|
|
|
|
"gmock",
|
|
|
|
"gtest",
|
|
|
|
"pixman-1",
|
|
|
|
]
|
|
|
|
defines = sommelier_defines
|
|
|
|
deps = [ ":libsommelier" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (use.fuzzer) {
|
|
|
|
executable("sommelier_wayland_fuzzer") {
|
|
|
|
sources = [ "sommelier-wayland-fuzzer.cc" ]
|
|
|
|
pkg_deps = [ "pixman-1" ]
|
|
|
|
libs = [ "pixman-1" ]
|
|
|
|
|
|
|
|
configs += [ "//common-mk/common_fuzzer" ]
|
|
|
|
|
|
|
|
defines = sommelier_defines
|
|
|
|
|
|
|
|
deps = [ ":libsommelier" ]
|
|
|
|
}
|
2019-09-20 18:57:28 -04:00
|
|
|
}
|