| # Copyright 2019 The Chromium OS 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("wayland_protocol.gni") |
| |
| group("all") { |
| deps = [ ":sommelier" ] |
| } |
| |
| if (!defined(peer_cmd_prefix)) { |
| if (use.amd64) { |
| peer_cmd_prefix = "\"/opt/google/cros-containers/lib/ld-linux-x86-64.so.2 --library-path /opt/google/cros-containers/lib --inhibit-rpath \\\"\\\"\"" |
| } |
| if (use.arm) { |
| peer_cmd_prefix = "\"/opt/google/cros-containers/lib/ld-linux-armhf.so.3 --library-path /opt/google/cros-containers/lib --inhibit-rpath \\\"\\\"\"" |
| } |
| } |
| |
| # 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 shm driver to use for Xwayland. |
| if (!defined(xwayland_shm_driver)) { |
| xwayland_shm_driver = "\"virtwl\"" |
| } |
| |
| # Set this to the shm driver to use for wayland clients. |
| if (!defined(shm_driver)) { |
| shm_driver = "\"virtwl-dmabuf\"" |
| } |
| |
| # Set this to the virtwl device. |
| if (!defined(virtwl_device)) { |
| virtwl_device = "\"/dev/wl0\"" |
| } |
| |
| # 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", |
| "protocol/gtk-shell.xml", |
| "protocol/keyboard-extension-unstable-v1.xml", |
| "protocol/linux-dmabuf-unstable-v1.xml", |
| "protocol/pointer-constraints-unstable-v1.xml", |
| "protocol/relative-pointer-unstable-v1.xml", |
| "protocol/text-input-unstable-v1.xml", |
| "protocol/viewporter.xml", |
| "protocol/xdg-shell-unstable-v6.xml", |
| ] |
| } |
| |
| executable("sommelier") { |
| pkg_deps = [ |
| "gbm", |
| "libdrm", |
| "pixman-1", |
| "wayland-client", |
| "wayland-server", |
| "xcb", |
| "xcb-composite", |
| "xcb-xfixes", |
| "xkbcommon", |
| ] |
| libs = [ "m" ] |
| deps = [ ":sommelier-protocol" ] |
| sources = [ |
| "sommelier-compositor.cc", |
| "sommelier-data-device-manager.cc", |
| "sommelier-display.cc", |
| "sommelier-drm.cc", |
| "sommelier-gtk-shell.cc", |
| "sommelier-output.cc", |
| "sommelier-pointer-constraints.cc", |
| "sommelier-relative-pointer-manager.cc", |
| "sommelier-seat.cc", |
| "sommelier-shell.cc", |
| "sommelier-shm.cc", |
| "sommelier-subcompositor.cc", |
| "sommelier-text-input.cc", |
| "sommelier-tracing.cc", |
| "sommelier-viewporter.cc", |
| "sommelier-xdg-shell.cc", |
| "sommelier.cc", |
| ] |
| defines = [ |
| "_GNU_SOURCE", |
| "WL_HIDE_DEPRECATED", |
| "XWAYLAND_PATH=${xwayland_path}", |
| "XWAYLAND_GL_DRIVER_PATH=${xwayland_gl_driver_path}", |
| "XWAYLAND_SHM_DRIVER=${xwayland_shm_driver}", |
| "SHM_DRIVER=${shm_driver}", |
| "VIRTWL_DEVICE=${virtwl_device}", |
| "PEER_CMD_PREFIX=${peer_cmd_prefix}", |
| "FRAME_COLOR=${frame_color}", |
| "DARK_FRAME_COLOR=${dark_frame_color}", |
| ] |
| } |