aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/meson.build')
-rw-r--r--protocols/meson.build73
1 files changed, 73 insertions, 0 deletions
diff --git a/protocols/meson.build b/protocols/meson.build
new file mode 100644
index 00000000..7f83b16b
--- /dev/null
+++ b/protocols/meson.build
@@ -0,0 +1,73 @@
1wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')
2
3wayland_scanner = find_program('wayland-scanner')
4
5wayland_scanner_code = generator(
6 wayland_scanner,
7 output: '@BASENAME@-protocol.c',
8 arguments: ['code', '@INPUT@', '@OUTPUT@'],
9)
10
11wayland_scanner_client = generator(
12 wayland_scanner,
13 output: '@BASENAME@-client-protocol.h',
14 arguments: ['client-header', '@INPUT@', '@OUTPUT@'],
15)
16
17wayland_scanner_server = generator(
18 wayland_scanner,
19 output: '@BASENAME@-protocol.h',
20 arguments: ['server-header', '@INPUT@', '@OUTPUT@'],
21)
22
23client_protocols = [
24 [wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
25 ['wlr-layer-shell-unstable-v1.xml'],
26 ['wlr-input-inhibitor-unstable-v1.xml']
27]
28
29server_protocols = [
30 [wl_protocol_dir, 'unstable/xdg-shell/xdg-shell-unstable-v6.xml'],
31 ['wlr-layer-shell-unstable-v1.xml'],
32 ['wlr-input-inhibitor-unstable-v1.xml']
33]
34
35client_protos_src = []
36client_protos_headers = []
37
38server_protos_src = []
39server_protos_headers = []
40
41foreach p : client_protocols
42 xml = join_paths(p)
43 client_protos_src += wayland_scanner_code.process(xml)
44 client_protos_headers += wayland_scanner_client.process(xml)
45endforeach
46
47foreach p : server_protocols
48 xml = join_paths(p)
49 server_protos_src += wayland_scanner_code.process(xml)
50 server_protos_headers += wayland_scanner_server.process(xml)
51endforeach
52
53lib_client_protos = static_library(
54 'client_protos',
55 client_protos_src + client_protos_headers,
56 dependencies: [wayland_client]
57) # for the include directory
58
59client_protos = declare_dependency(
60 link_with: lib_client_protos,
61 sources: client_protos_headers,
62)
63
64lib_server_protos = static_library(
65 'server_protos',
66 server_protos_src + server_protos_headers,
67 dependencies: [wayland_client]
68) # for the include directory
69
70server_protos = declare_dependency(
71 link_with: lib_server_protos,
72 sources: server_protos_headers,
73)