mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
meson: use the wayland module
This module has existed, unchanged, since Meson 0.64, and is now marked as API stable in 1.8. It provides a number of helpers that reduce the amount of code we need (including fiddly code about finding wayland-scanner) by a bit, as well as some nice helpers for finding external XML files. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35839>
This commit is contained in:
parent
943ac08280
commit
0c11a9cfb3
3 changed files with 14 additions and 48 deletions
|
|
@ -1999,13 +1999,6 @@ endif
|
||||||
|
|
||||||
with_wayland_bind_display = with_platform_wayland and get_option('legacy-wayland').contains('bind-wayland-display')
|
with_wayland_bind_display = with_platform_wayland and get_option('legacy-wayland').contains('bind-wayland-display')
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
dep_wl_scanner = dependency('wayland-scanner', native: true)
|
|
||||||
prog_wl_scanner = find_program(dep_wl_scanner.get_variable(pkgconfig : 'wayland_scanner'))
|
|
||||||
if dep_wl_scanner.version().version_compare('>= 1.15')
|
|
||||||
wl_scanner_arg = 'private-code'
|
|
||||||
else
|
|
||||||
wl_scanner_arg = 'code'
|
|
||||||
endif
|
|
||||||
dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.41', default_options: [ 'tests=false' ])
|
dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.41', default_options: [ 'tests=false' ])
|
||||||
dep_wayland_client = dependency('wayland-client', version : '>=1.18')
|
dep_wayland_client = dependency('wayland-client', version : '>=1.18')
|
||||||
dep_wayland_server = dependency('wayland-server', version : '>=1.18')
|
dep_wayland_server = dependency('wayland-server', version : '>=1.18')
|
||||||
|
|
@ -2026,6 +2019,8 @@ if with_platform_wayland
|
||||||
dependencies: dep_wayland_client)
|
dependencies: dep_wayland_client)
|
||||||
pre_args += ['-DHAVE_WL_CREATE_QUEUE_WITH_NAME']
|
pre_args += ['-DHAVE_WL_CREATE_QUEUE_WITH_NAME']
|
||||||
endif
|
endif
|
||||||
|
# This can be renamed just `wayland` when we require at least 1.8
|
||||||
|
mod_wl = import('unstable-wayland')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Even if we find OpenMP, Gitlab CI fails to link with gcc/i386 and clang/anyarch.
|
# Even if we find OpenMP, Gitlab CI fails to link with gcc/i386 and clang/anyarch.
|
||||||
|
|
|
||||||
|
|
@ -3,26 +3,10 @@
|
||||||
|
|
||||||
inc_wayland_drm = include_directories('.')
|
inc_wayland_drm = include_directories('.')
|
||||||
|
|
||||||
wayland_drm_protocol_c = custom_target(
|
_wl_drm = mod_wl.scan_xml('wayland-drm.xml', server : true, include_core_only : false)
|
||||||
'wayland-drm-protocol.c',
|
wayland_drm_protocol_c = _wl_drm[0]
|
||||||
input : 'wayland-drm.xml',
|
wayland_drm_client_protocol_h = _wl_drm[1]
|
||||||
output : 'wayland-drm-protocol.c',
|
wayland_drm_server_protocol_h = _wl_drm[2]
|
||||||
command : [prog_wl_scanner, wl_scanner_arg, '@INPUT@', '@OUTPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
wayland_drm_client_protocol_h = custom_target(
|
|
||||||
'wayland-drm-client-protocol.h',
|
|
||||||
input : 'wayland-drm.xml',
|
|
||||||
output : 'wayland-drm-client-protocol.h',
|
|
||||||
command : [prog_wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
wayland_drm_server_protocol_h = custom_target(
|
|
||||||
'wayland-drm-server-protocol.h',
|
|
||||||
input : 'wayland-drm.xml',
|
|
||||||
output : 'wayland-drm-server-protocol.h',
|
|
||||||
command : [prog_wl_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
libwayland_drm = static_library(
|
libwayland_drm = static_library(
|
||||||
'wayland_drm',
|
'wayland_drm',
|
||||||
|
|
|
||||||
|
|
@ -4,31 +4,18 @@
|
||||||
inc_loader = include_directories('.')
|
inc_loader = include_directories('.')
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
wp_dir = dep_wl_protocols.get_variable(pkgconfig : 'pkgdatadir', internal : 'pkgdatadir')
|
|
||||||
wp_protos = {
|
wp_protos = {
|
||||||
'fifo-v1': 'staging/fifo/fifo-v1.xml',
|
'fifo-v1': mod_wl.find_protocol('fifo', state : 'staging', version : 1),
|
||||||
'commit-timing-v1': 'staging/commit-timing/commit-timing-v1.xml',
|
'commit-timing-v1': mod_wl.find_protocol('commit-timing', state : 'staging', version : 1),
|
||||||
'linux-dmabuf-unstable-v1': 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml',
|
'linux-dmabuf-unstable-v1': mod_wl.find_protocol('linux-dmabuf', state : 'unstable', version : 1),
|
||||||
'presentation-time': 'stable/presentation-time/presentation-time.xml',
|
'presentation-time': mod_wl.find_protocol('presentation-time'),
|
||||||
'tearing-control-v1': 'staging/tearing-control/tearing-control-v1.xml',
|
'tearing-control-v1': mod_wl.find_protocol('tearing-control', state : 'staging', version : 1),
|
||||||
'linux-drm-syncobj-v1': 'staging/linux-drm-syncobj/linux-drm-syncobj-v1.xml',
|
'linux-drm-syncobj-v1': mod_wl.find_protocol('linux-drm-syncobj', state : 'staging', version : 1),
|
||||||
'color-management-v1': 'staging/color-management/color-management-v1.xml',
|
'color-management-v1': mod_wl.find_protocol('color-management', state : 'staging', version : 1)
|
||||||
}
|
}
|
||||||
wp_files = {}
|
wp_files = {}
|
||||||
foreach name, xml : wp_protos
|
foreach name, xml : wp_protos
|
||||||
code = custom_target(
|
wp_files += {name : mod_wl.scan_xml(xml, include_core_only : false)}
|
||||||
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
|
endforeach
|
||||||
|
|
||||||
libloader_wayland_helper = static_library(
|
libloader_wayland_helper = static_library(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue