101e04c3fSmrg# Copyright © 2017 Intel Corporation
201e04c3fSmrg
301e04c3fSmrg# Permission is hereby granted, free of charge, to any person obtaining a copy
401e04c3fSmrg# of this software and associated documentation files (the "Software"), to deal
501e04c3fSmrg# in the Software without restriction, including without limitation the rights
601e04c3fSmrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
701e04c3fSmrg# copies of the Software, and to permit persons to whom the Software is
801e04c3fSmrg# furnished to do so, subject to the following conditions:
901e04c3fSmrg
1001e04c3fSmrg# The above copyright notice and this permission notice shall be included in
1101e04c3fSmrg# all copies or substantial portions of the Software.
1201e04c3fSmrg
1301e04c3fSmrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1401e04c3fSmrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1501e04c3fSmrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1601e04c3fSmrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1701e04c3fSmrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1801e04c3fSmrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1901e04c3fSmrg# SOFTWARE.
2001e04c3fSmrg
2101e04c3fSmrginc_wayland_drm = include_directories('.')
2201e04c3fSmrg
2301e04c3fSmrgwayland_drm_protocol_c = custom_target(
2401e04c3fSmrg  'wayland-drm-protocol.c',
2501e04c3fSmrg  input : 'wayland-drm.xml',
2601e04c3fSmrg  output : 'wayland-drm-protocol.c',
2701e04c3fSmrg  command : [prog_wl_scanner, wl_scanner_arg, '@INPUT@', '@OUTPUT@'],
2801e04c3fSmrg)
2901e04c3fSmrg
3001e04c3fSmrgwayland_drm_client_protocol_h = custom_target(
3101e04c3fSmrg  'wayland-drm-client-protocol.h',
3201e04c3fSmrg  input : 'wayland-drm.xml',
3301e04c3fSmrg  output : 'wayland-drm-client-protocol.h',
3401e04c3fSmrg  command : [prog_wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
3501e04c3fSmrg)
3601e04c3fSmrg
3701e04c3fSmrgwayland_drm_server_protocol_h = custom_target(
3801e04c3fSmrg  'wayland-drm-server-protocol.h',
3901e04c3fSmrg  input : 'wayland-drm.xml',
4001e04c3fSmrg  output : 'wayland-drm-server-protocol.h',
4101e04c3fSmrg  command : [prog_wl_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
4201e04c3fSmrg)
4301e04c3fSmrg
4401e04c3fSmrglibwayland_drm = static_library(
4501e04c3fSmrg  'wayland_drm',
4601e04c3fSmrg  ['wayland-drm.c', wayland_drm_protocol_c, wayland_drm_server_protocol_h],
477ec681f3Smrg  gnu_symbol_visibility : 'hidden',
4801e04c3fSmrg  dependencies : [dep_wayland_server],
4901e04c3fSmrg  build_by_default : false,
5001e04c3fSmrg)
5101e04c3fSmrg
5201e04c3fSmrg# linux-dmabuf isn't part of wayland-drm, but this happens to be the only
5301e04c3fSmrg# place which is a) guaranteed to be built when building either or both
5401e04c3fSmrg# of EGL and Vulkan WSI, and b) guaranteed to be included before both,
5501e04c3fSmrg# so the targets are actually defined by the time the files come to be
5601e04c3fSmrg# used.
5701e04c3fSmrg#
5801e04c3fSmrg# Moving these to a src/wsi/ was suggested but shot down, so put these
5901e04c3fSmrg# here for now as the maybe-least-bad solution.
6001e04c3fSmrglinux_dmabuf_unstable_v1_protocol_c = custom_target(
6101e04c3fSmrg  'linux-dmabuf-unstable-v1-protocol.c',
6201e04c3fSmrg  input : wayland_dmabuf_xml,
6301e04c3fSmrg  output : 'linux-dmabuf-unstable-v1-protocol.c',
6401e04c3fSmrg  command : [prog_wl_scanner, wl_scanner_arg, '@INPUT@', '@OUTPUT@'],
6501e04c3fSmrg)
6601e04c3fSmrg
6701e04c3fSmrglinux_dmabuf_unstable_v1_client_protocol_h = custom_target(
6801e04c3fSmrg  'linux-dmabuf-unstable-v1-client-protocol.h',
6901e04c3fSmrg  input : wayland_dmabuf_xml,
7001e04c3fSmrg  output : 'linux-dmabuf-unstable-v1-client-protocol.h',
7101e04c3fSmrg  command : [prog_wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
7201e04c3fSmrg)
73