xref: /aosp_15_r20/external/mesa3d/src/egl/wayland/wayland-drm/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2017 Intel Corporation
2# SPDX-License-Identifier: MIT
3
4inc_wayland_drm = include_directories('.')
5
6wayland_drm_protocol_c = custom_target(
7  'wayland-drm-protocol.c',
8  input : 'wayland-drm.xml',
9  output : 'wayland-drm-protocol.c',
10  command : [prog_wl_scanner, wl_scanner_arg, '@INPUT@', '@OUTPUT@'],
11)
12
13wayland_drm_client_protocol_h = custom_target(
14  'wayland-drm-client-protocol.h',
15  input : 'wayland-drm.xml',
16  output : 'wayland-drm-client-protocol.h',
17  command : [prog_wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
18)
19
20wayland_drm_server_protocol_h = custom_target(
21  'wayland-drm-server-protocol.h',
22  input : 'wayland-drm.xml',
23  output : 'wayland-drm-server-protocol.h',
24  command : [prog_wl_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
25)
26
27libwayland_drm = static_library(
28  'wayland_drm',
29  ['wayland-drm.c', wayland_drm_protocol_c, wayland_drm_server_protocol_h],
30  gnu_symbol_visibility : 'hidden',
31  dependencies : [dep_wayland_server],
32  build_by_default : false,
33)
34
35# linux-dmabuf isn't part of wayland-drm, but this happens to be the only
36# place which is a) guaranteed to be built when building either or both
37# of EGL and Vulkan WSI, and b) guaranteed to be included before both,
38# so the targets are actually defined by the time the files come to be
39# used.
40#
41# Moving these to a src/wsi/ was suggested but shot down, so put these
42# here for now as the maybe-least-bad solution.
43wp_dir = dep_wl_protocols.get_variable(pkgconfig : 'pkgdatadir', internal : 'pkgdatadir')
44wp_protos = {
45  'linux-dmabuf-unstable-v1': 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml',
46  'presentation-time': 'stable/presentation-time/presentation-time.xml',
47  'tearing-control-v1': 'staging/tearing-control/tearing-control-v1.xml',
48  'linux-drm-syncobj-v1': 'staging/linux-drm-syncobj/linux-drm-syncobj-v1.xml',
49}
50wp_files = {}
51foreach name, xml : wp_protos
52  code = custom_target(
53    name + '-protocol.c',
54    input : files(join_paths(wp_dir, xml)),
55    output : name + '-protocol.c',
56    command : [prog_wl_scanner, wl_scanner_arg, '@INPUT@', '@OUTPUT@'],
57  )
58  header = custom_target(
59    name + '-client-protocol.h',
60    input : files(join_paths(wp_dir, xml)),
61    output : name + '-client-protocol.h',
62    command : [prog_wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
63  )
64  wp_files += { name: [code, header] }
65endforeach
66