blob: 50b6275ddaf480644b46ae612bb5ecfa8efa0998 [file] [log] [blame]
# 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.
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//testing/test.gni")
import("//ui/base/ui_features.gni")
import("//ui/ozone/ozone.gni")
declare_args() {
# Enable experimental vulkan wayland client.
enable_vulkan_wayland_client = false
}
if (use_xkbcommon) {
pkg_config("xkbcommon") {
packages = [ "xkbcommon" ]
}
}
if (use_ozone) {
if (enable_vulkan_wayland_client) {
pkg_config("vulkan") {
packages = [ "vulkan" ]
}
}
}
source_set("wayland") {
sources = [
"scoped_wl.cc",
"scoped_wl.h",
"server.cc",
"server.h",
"server_util.cc",
"server_util.h",
"wayland_display_observer.cc",
"wayland_display_observer.h",
"wayland_display_output.cc",
"wayland_display_output.h",
"wayland_input_delegate.cc",
"wayland_input_delegate.h",
"wayland_touch_delegate.cc",
"wayland_touch_delegate.h",
"wayland_watcher.cc",
"wayland_watcher.h",
"wl_compositor.cc",
"wl_compositor.h",
"wl_data_device_manager.cc",
"wl_data_device_manager.h",
"wl_output.cc",
"wl_output.h",
"wl_seat.cc",
"wl_seat.h",
"wl_shm.cc",
"wl_shm.h",
"wl_subcompositor.cc",
"wl_subcompositor.h",
"wp_presentation.cc",
"wp_presentation.h",
"wp_viewporter.cc",
"wp_viewporter.h",
"zcr_alpha_compositing.cc",
"zcr_alpha_compositing.h",
"zcr_secure_output.cc",
"zcr_secure_output.h",
"zcr_stylus.cc",
"zcr_stylus.h",
"zcr_vsync_feedback.cc",
"zcr_vsync_feedback.h",
]
defines = [ "EXO_IMPLEMENTATION" ]
if (is_chromeos) {
sources += [
"wayland_keyboard_delegate.cc",
"wayland_keyboard_delegate.h",
"wayland_pointer_delegate.cc",
"wayland_pointer_delegate.h",
"wl_shell.cc",
"wl_shell.h",
"zaura_shell.cc",
"zaura_shell.h",
"zcr_cursor_shapes.cc",
"zcr_cursor_shapes.h",
"zcr_gaming_input.cc",
"zcr_gaming_input.h",
"zcr_keyboard_configuration.cc",
"zcr_keyboard_configuration.h",
"zcr_keyboard_extension.cc",
"zcr_keyboard_extension.h",
"zcr_notification_shell.cc",
"zcr_notification_shell.h",
"zcr_remote_shell.cc",
"zcr_remote_shell.h",
"zcr_stylus_tools.cc",
"zcr_stylus_tools.h",
"zwp_input_timestamps_manager.cc",
"zwp_input_timestamps_manager.h",
"zwp_linux_explicit_synchronization.cc",
"zwp_linux_explicit_synchronization.h",
"zwp_pointer_gestures.cc",
"zwp_pointer_gestures.h",
"zwp_relative_pointer_manager.cc",
"zwp_relative_pointer_manager.h",
"zwp_text_input_manager.cc",
"zwp_text_input_manager.h",
"zxdg_shell.cc",
"zxdg_shell.h",
]
}
deps = [
"//base",
"//components/exo",
"//components/exo/wayland/protocol:aura_shell_protocol",
"//device/gamepad",
"//services/viz/public/interfaces",
"//skia",
"//third_party/wayland:wayland_server",
"//third_party/wayland-protocols:alpha_compositing_protocol",
"//third_party/wayland-protocols:cursor_shapes_protocol",
"//third_party/wayland-protocols:gaming_input_protocol",
"//third_party/wayland-protocols:input_timestamps_protocol",
"//third_party/wayland-protocols:keyboard_configuration_protocol",
"//third_party/wayland-protocols:keyboard_extension_protocol",
"//third_party/wayland-protocols:linux_explicit_synchronization_protocol",
"//third_party/wayland-protocols:notification_shell_protocol",
"//third_party/wayland-protocols:pointer_gestures_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//third_party/wayland-protocols:relative_pointer_protocol",
"//third_party/wayland-protocols:remote_shell_protocol",
"//third_party/wayland-protocols:secure_output_protocol",
"//third_party/wayland-protocols:stylus_protocol",
"//third_party/wayland-protocols:stylus_tools_protocol",
"//third_party/wayland-protocols:text_input_protocol",
"//third_party/wayland-protocols:viewporter_protocol",
"//third_party/wayland-protocols:vsync_feedback_protocol",
"//third_party/wayland-protocols:xdg_shell_protocol",
"//ui/aura",
"//ui/base",
"//ui/display/manager",
"//ui/events:dom_keycode_converter",
"//ui/events:events_base",
"//ui/views",
"//ui/wm:wm",
"//ui/wm/public",
]
if (use_ozone) {
sources += [
"zwp_linux_dmabuf.cc",
"zwp_linux_dmabuf.h",
]
deps += [
"//build/config/linux/libdrm",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
]
if (is_chromeos) {
deps += [
"//ash/public/cpp",
"//ui/events/ozone:events_ozone_layout",
]
}
}
if (use_xkbcommon) {
configs += [ ":xkbcommon" ]
deps += [ "//ui/events/keycodes:xkb" ]
}
if (is_chromecast) {
defines += [ "USE_FULLSCREEN_SHELL" ]
sources += [
"zwp_fullscreen_shell.cc",
"zwp_fullscreen_shell.h",
]
deps += [ "//third_party/wayland-protocols:fullscreen_shell_protocol" ]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"server_unittest.cc",
]
deps = [
":wayland",
"//base",
"//components/exo",
"//components/exo:test_support",
"//skia",
"//testing/gtest",
"//third_party/wayland:wayland_client",
]
if (is_chromeos) {
sources += [ "server_util_unittest.cc" ]
deps += [
"//ui/display",
"//ui/gfx",
]
}
}
config("client_support_config") {
if (ozone_platform_gbm) {
defines = [ "USE_GBM" ]
if (enable_vulkan_wayland_client) {
defines += [ "USE_VULKAN" ]
}
}
}
source_set("client_support") {
sources = [
"clients/client_base.cc",
"clients/client_base.h",
"clients/client_helper.cc",
"clients/client_helper.h",
]
deps = [
"//base",
"//ui/gl",
"//ui/gl/init",
]
public_deps = [
"//components/exo/wayland/protocol:aura_shell_protocol",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:fullscreen_shell_protocol",
"//third_party/wayland-protocols:input_timestamps_protocol",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:linux_explicit_synchronization_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
]
if (ozone_platform_gbm) {
configs += [ "//ui/gl:gl_config" ]
if (enable_vulkan_wayland_client) {
configs += [ ":vulkan" ]
}
deps += [
"//build/config/linux/libdrm",
"//ui/ozone",
]
public_deps += [ "//third_party/minigbm" ]
}
public_configs = [ ":client_support_config" ]
}
executable("wayland_rects_client") {
sources = [
"clients/rects.cc",
]
deps = [
":client_support",
"//base",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:input_timestamps_protocol",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//ui/gfx/geometry",
"//ui/gl",
]
if (ozone_platform_gbm) {
configs += [ "//ui/gl:gl_config" ]
defines = [ "USE_GBM" ]
deps += [
"//build/config/linux/libdrm",
"//third_party/minigbm",
]
}
}
source_set("simple") {
sources = [
"clients/simple.cc",
"clients/simple.h",
]
deps = [
":client_support",
"//base",
"//build/config/linux/libdrm",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//ui/gfx/geometry",
"//ui/gl",
]
if (ozone_platform_gbm) {
configs += [ "//ui/gl:gl_config" ]
}
}
source_set("fullscreen_shell") {
sources = [
"clients/fullscreen_shell.cc",
"clients/fullscreen_shell.h",
]
deps = [
":client_support",
"//base",
"//build/config/linux/libdrm",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//ui/gfx/geometry",
"//ui/gl",
]
if (ozone_platform_gbm) {
configs += [ "//ui/gl:gl_config" ]
}
}
executable("wayland_simple_client") {
sources = [
"clients/simple_main.cc",
]
deps = [
":client_support",
":simple",
"//base",
]
}
executable("wayland_fullscreen_client") {
sources = [
"clients/fullscreen_shell_main.cc",
]
deps = [
":client_support",
":fullscreen_shell",
"//base",
]
}
executable("wayland_subsurface_client") {
sources = [
"clients/subsurface.cc",
]
deps = [
":client_support",
"//base",
"//build/config/linux/libdrm",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//ui/gfx/geometry",
"//ui/gl",
]
if (ozone_platform_gbm) {
configs += [ "//ui/gl:gl_config" ]
}
}
source_set("blur") {
sources = [
"clients/blur.cc",
"clients/blur.h",
]
deps = [
":client_support",
"//base",
"//build/config/linux/libdrm",
"//skia",
"//third_party/wayland:wayland_client",
"//ui/gfx/geometry",
"//ui/gl",
]
if (ozone_platform_gbm) {
configs += [ "//ui/gl:gl_config" ]
}
}
executable("wayland_blur_client") {
sources = [
"clients/blur_main.cc",
]
deps = [
":blur",
":client_support",
"//base",
]
}
executable("wayland_info_client") {
sources = [
"clients/info.cc",
]
deps = [
":client_support",
"//base",
"//third_party/wayland:wayland_client",
"//ui/gfx/geometry",
]
}
test("wayland_client_perftests") {
sources = [
"clients/perftests.cc",
"clients/test/run_all_client_perftests.cc",
"clients/test/wayland_client_test.cc",
"clients/test/wayland_client_test.h",
]
deps = [
":blur",
":client_support",
":simple",
":wayland",
"//base",
"//base/test:test_support",
"//cc:test_support",
"//components/exo",
"//components/viz/test:test_support",
"//mojo/core/embedder",
"//testing/gtest",
"//testing/perf",
"//ui/aura",
"//ui/aura:test_support",
"//ui/base",
"//ui/compositor:test_support",
"//ui/events:gesture_detection",
"//ui/gl:test_support",
"//ui/wm",
]
data_deps = []
if (is_chromeos) {
sources += [
"../../../ash/test/ash_test_suite.cc",
"../../../ash/test/ash_test_suite.h",
]
data_deps += [
"//ash/strings:ash_test_strings",
"//ash/resources:ash_test_resources_100_percent",
"//ash/resources:ash_test_resources_200_percent",
]
deps += [
"//ash",
"//ash:test_support",
"//ash/public/cpp",
]
}
}
if (ozone_platform_gbm) {
executable("wayland_yuv_client") {
sources = [
"clients/yuv.cc",
]
deps = [
":client_support",
"//base",
"//build/config/linux/libdrm",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//ui/gfx/geometry",
]
configs += [ "//ui/gl:gl_config" ]
deps += [ "//third_party/minigbm" ]
}
executable("wayland_explicit_synchronization_client") {
sources = [
"clients/explicit_synchronization.cc",
]
deps = [
":client_support",
"//base",
"//build/config/linux/libdrm",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:linux_explicit_synchronization_protocol",
"//ui/gl",
]
configs += [ "//ui/gl:gl_config" ]
}
if (enable_vulkan_wayland_client) {
executable("wayland_vulkan_client") {
sources = [
"clients/vulkan.cc",
]
deps = [
":client_support",
"//base",
"//build/config/linux/libdrm",
"//skia",
"//third_party/wayland:wayland_client",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:presentation_time_protocol",
"//ui/gfx/geometry",
]
configs += [ "//ui/gl:gl_config" ]
deps += [ "//third_party/minigbm" ]
}
}
}