From 3c65b8d9e061a2f828aa8c1502784f256a430875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 1 Feb 2023 17:49:08 +0100 Subject: [PATCH] build: Store generated Wayland protocol files in table This makes it possible for e.g. test cases to pick protocol extensions to include. Part-of: --- src/meson.build | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/meson.build b/src/meson.build index cf3abd0d9..c908e48e8 100644 --- a/src/meson.build +++ b/src/meson.build @@ -992,6 +992,8 @@ wayland_protocol_server_headers = [] wayland_protocol_client_headers = [] wayland_protocol_sources = [] +wayland_protocol_files = {} + if have_wayland # Format: # - protocol name @@ -1063,7 +1065,7 @@ if have_wayland output_base)) endif - wayland_protocol_server_headers += custom_target('@0@ server header'.format(output_base), + server_header = custom_target('@0@ server header'.format(output_base), input: input, output: '@0@-server-protocol.h'.format(output_base), command: [ @@ -1072,9 +1074,7 @@ if have_wayland '@INPUT@', '@OUTPUT@', ] ) - - # used by tests - wayland_protocol_client_headers += custom_target('@0@ client header'.format(output_base), + client_header = custom_target('@0@ client header'.format(output_base), input: input, output: '@0@-client-protocol.h'.format(output_base), command: [ @@ -1083,8 +1083,7 @@ if have_wayland '@INPUT@', '@OUTPUT@', ] ) - - wayland_protocol_sources += custom_target('@0@ source'.format(output_base), + protocol_code = custom_target('@0@ source'.format(output_base), input: input, output: '@0@-protocol.c'.format(output_base), command: [ @@ -1093,6 +1092,18 @@ if have_wayland '@INPUT@', '@OUTPUT@', ] ) + + wayland_protocol_files += { + protocol_name: { + 'server-header': server_header, + 'client-header': client_header, + 'protocol-code': protocol_code, + }, + } + + wayland_protocol_server_headers += server_header + wayland_protocol_client_headers += client_header + wayland_protocol_sources += protocol_code endforeach endif