diff options
Diffstat (limited to 'protocols/meson.build')
-rw-r--r-- | protocols/meson.build | 73 |
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 @@ | |||
1 | wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir') | ||
2 | |||
3 | wayland_scanner = find_program('wayland-scanner') | ||
4 | |||
5 | wayland_scanner_code = generator( | ||
6 | wayland_scanner, | ||
7 | output: '@BASENAME@-protocol.c', | ||
8 | arguments: ['code', '@INPUT@', '@OUTPUT@'], | ||
9 | ) | ||
10 | |||
11 | wayland_scanner_client = generator( | ||
12 | wayland_scanner, | ||
13 | output: '@BASENAME@-client-protocol.h', | ||
14 | arguments: ['client-header', '@INPUT@', '@OUTPUT@'], | ||
15 | ) | ||
16 | |||
17 | wayland_scanner_server = generator( | ||
18 | wayland_scanner, | ||
19 | output: '@BASENAME@-protocol.h', | ||
20 | arguments: ['server-header', '@INPUT@', '@OUTPUT@'], | ||
21 | ) | ||
22 | |||
23 | client_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 | |||
29 | server_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 | |||
35 | client_protos_src = [] | ||
36 | client_protos_headers = [] | ||
37 | |||
38 | server_protos_src = [] | ||
39 | server_protos_headers = [] | ||
40 | |||
41 | foreach 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) | ||
45 | endforeach | ||
46 | |||
47 | foreach 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) | ||
51 | endforeach | ||
52 | |||
53 | lib_client_protos = static_library( | ||
54 | 'client_protos', | ||
55 | client_protos_src + client_protos_headers, | ||
56 | dependencies: [wayland_client] | ||
57 | ) # for the include directory | ||
58 | |||
59 | client_protos = declare_dependency( | ||
60 | link_with: lib_client_protos, | ||
61 | sources: client_protos_headers, | ||
62 | ) | ||
63 | |||
64 | lib_server_protos = static_library( | ||
65 | 'server_protos', | ||
66 | server_protos_src + server_protos_headers, | ||
67 | dependencies: [wayland_client] | ||
68 | ) # for the include directory | ||
69 | |||
70 | server_protos = declare_dependency( | ||
71 | link_with: lib_server_protos, | ||
72 | sources: server_protos_headers, | ||
73 | ) | ||