loader: Move the wayland protocol build into loader

We can hang this here instead of off wayland-drm's build.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32757>
This commit is contained in:
Derek Foreman
2024-12-12 12:27:49 -06:00
parent d09594cc40
commit d8c8a7fb6e
2 changed files with 27 additions and 35 deletions
-35
View File
@@ -31,38 +31,3 @@ libwayland_drm = static_library(
dependencies : [dep_wayland_server],
build_by_default : false,
)
# linux-dmabuf isn't part of wayland-drm, but this happens to be the only
# place which is a) guaranteed to be built when building either or both
# of EGL and Vulkan WSI, and b) guaranteed to be included before both,
# so the targets are actually defined by the time the files come to be
# used.
#
# Moving these to a src/wsi/ was suggested but shot down, so put these
# here for now as the maybe-least-bad solution.
wp_dir = dep_wl_protocols.get_variable(pkgconfig : 'pkgdatadir', internal : 'pkgdatadir')
wp_protos = {
'fifo-v1': 'staging/fifo/fifo-v1.xml',
'commit-timing-v1': 'staging/commit-timing/commit-timing-v1.xml',
'linux-dmabuf-unstable-v1': 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml',
'presentation-time': 'stable/presentation-time/presentation-time.xml',
'tearing-control-v1': 'staging/tearing-control/tearing-control-v1.xml',
'linux-drm-syncobj-v1': 'staging/linux-drm-syncobj/linux-drm-syncobj-v1.xml',
'color-management-v1': 'staging/color-management/color-management-v1.xml',
}
wp_files = {}
foreach name, xml : wp_protos
code = custom_target(
name + '-protocol.c',
input : files(join_paths(wp_dir, xml)),
output : name + '-protocol.c',
command : [prog_wl_scanner, wl_scanner_arg, '@INPUT@', '@OUTPUT@'],
)
header = custom_target(
name + '-client-protocol.h',
input : files(join_paths(wp_dir, xml)),
output : name + '-client-protocol.h',
command : [prog_wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
)
wp_files += { name: [code, header] }
endforeach
+27
View File
@@ -4,6 +4,33 @@
inc_loader = include_directories('.')
if with_platform_wayland
wp_dir = dep_wl_protocols.get_variable(pkgconfig : 'pkgdatadir', internal : 'pkgdatadir')
wp_protos = {
'fifo-v1': 'staging/fifo/fifo-v1.xml',
'commit-timing-v1': 'staging/commit-timing/commit-timing-v1.xml',
'linux-dmabuf-unstable-v1': 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml',
'presentation-time': 'stable/presentation-time/presentation-time.xml',
'tearing-control-v1': 'staging/tearing-control/tearing-control-v1.xml',
'linux-drm-syncobj-v1': 'staging/linux-drm-syncobj/linux-drm-syncobj-v1.xml',
'color-management-v1': 'staging/color-management/color-management-v1.xml',
}
wp_files = {}
foreach name, xml : wp_protos
code = custom_target(
name + '-protocol.c',
input : files(join_paths(wp_dir, xml)),
output : name + '-protocol.c',
command : [prog_wl_scanner, wl_scanner_arg, '@INPUT@', '@OUTPUT@'],
)
header = custom_target(
name + '-client-protocol.h',
input : files(join_paths(wp_dir, xml)),
output : name + '-client-protocol.h',
command : [prog_wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
)
wp_files += { name: [code, header] }
endforeach
libloader_wayland_helper = static_library(
'loader_wayland_helper',
'loader_wayland_helper.c',