diff options
Diffstat (limited to 'protocols/meson.build')
-rw-r--r-- | protocols/meson.build | 76 |
1 files changed, 19 insertions, 57 deletions
diff --git a/protocols/meson.build b/protocols/meson.build index df24a4e5..81edb584 100644 --- a/protocols/meson.build +++ b/protocols/meson.build | |||
@@ -1,81 +1,43 @@ | |||
1 | wl_protocol_dir = wayland_protos.get_variable('pkgdatadir') | 1 | wl_protocol_dir = wayland_protos.get_variable('pkgdatadir') |
2 | 2 | ||
3 | wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true) | 3 | wayland_scanner_dep = dependency('wayland-scanner', native: true) |
4 | if wayland_scanner_dep.found() | 4 | wayland_scanner = find_program( |
5 | wayland_scanner = find_program( | 5 | wayland_scanner_dep.get_variable('wayland_scanner'), |
6 | wayland_scanner_dep.get_variable(pkgconfig: 'wayland_scanner'), | 6 | native: true, |
7 | native: true, | 7 | ) |
8 | ) | ||
9 | else | ||
10 | wayland_scanner = find_program('wayland-scanner', native: true) | ||
11 | endif | ||
12 | 8 | ||
13 | protocols = [ | 9 | protocols = [ |
14 | [wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'], | 10 | wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml', |
15 | [wl_protocol_dir, 'unstable/xdg-output/xdg-output-unstable-v1.xml'], | 11 | wl_protocol_dir / 'unstable/xdg-output/xdg-output-unstable-v1.xml', |
16 | [wl_protocol_dir, 'unstable/pointer-constraints/pointer-constraints-unstable-v1.xml'], | 12 | wl_protocol_dir / 'unstable/pointer-constraints/pointer-constraints-unstable-v1.xml', |
17 | [wl_protocol_dir, 'unstable/tablet/tablet-unstable-v2.xml'], | 13 | wl_protocol_dir / 'unstable/tablet/tablet-unstable-v2.xml', |
18 | [wl_protocol_dir, 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'], | 14 | wl_protocol_dir / 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml', |
19 | ['wlr-layer-shell-unstable-v1.xml'], | 15 | wl_protocol_dir / 'staging/content-type/content-type-v1.xml', |
20 | ['idle.xml'], | 16 | wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml', |
21 | ['wlr-input-inhibitor-unstable-v1.xml'], | 17 | 'wlr-layer-shell-unstable-v1.xml', |
22 | ['wlr-output-power-management-unstable-v1.xml'], | 18 | 'idle.xml', |
23 | ] | 19 | 'wlr-output-power-management-unstable-v1.xml', |
24 | |||
25 | client_protocols = [ | ||
26 | [wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'], | ||
27 | [wl_protocol_dir, 'unstable/xdg-output/xdg-output-unstable-v1.xml'], | ||
28 | ['wlr-layer-shell-unstable-v1.xml'], | ||
29 | ['wlr-input-inhibitor-unstable-v1.xml'], | ||
30 | ] | 20 | ] |
31 | 21 | ||
32 | wl_protos_src = [] | 22 | wl_protos_src = [] |
33 | wl_protos_headers = [] | ||
34 | 23 | ||
35 | foreach p : protocols | 24 | foreach xml : protocols |
36 | xml = join_paths(p) | ||
37 | wl_protos_src += custom_target( | 25 | wl_protos_src += custom_target( |
38 | xml.underscorify() + '_server_c', | 26 | xml.underscorify() + '_c', |
39 | input: xml, | 27 | input: xml, |
40 | output: '@BASENAME@-protocol.c', | 28 | output: '@BASENAME@-protocol.c', |
41 | command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'], | 29 | command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'], |
42 | ) | 30 | ) |
43 | wl_protos_headers += custom_target( | 31 | wl_protos_src += custom_target( |
44 | xml.underscorify() + '_server_h', | 32 | xml.underscorify() + '_server_h', |
45 | input: xml, | 33 | input: xml, |
46 | output: '@BASENAME@-protocol.h', | 34 | output: '@BASENAME@-protocol.h', |
47 | command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'], | 35 | command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'], |
48 | ) | 36 | ) |
49 | endforeach | 37 | wl_protos_src += custom_target( |
50 | |||
51 | foreach p : client_protocols | ||
52 | xml = join_paths(p) | ||
53 | wl_protos_headers += custom_target( | ||
54 | xml.underscorify() + '_client_h', | 38 | xml.underscorify() + '_client_h', |
55 | input: xml, | 39 | input: xml, |
56 | output: '@BASENAME@-client-protocol.h', | 40 | output: '@BASENAME@-client-protocol.h', |
57 | command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'], | 41 | command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'], |
58 | ) | 42 | ) |
59 | endforeach | 43 | endforeach |
60 | |||
61 | lib_client_protos = static_library( | ||
62 | 'client_protos', | ||
63 | wl_protos_src + wl_protos_headers, | ||
64 | dependencies: wayland_client.partial_dependency(compile_args: true), | ||
65 | ) | ||
66 | |||
67 | client_protos = declare_dependency( | ||
68 | link_with: lib_client_protos, | ||
69 | sources: wl_protos_headers, | ||
70 | ) | ||
71 | |||
72 | lib_server_protos = static_library( | ||
73 | 'server_protos', | ||
74 | wl_protos_src + wl_protos_headers, | ||
75 | dependencies: wayland_server.partial_dependency(compile_args: true), | ||
76 | ) | ||
77 | |||
78 | server_protos = declare_dependency( | ||
79 | link_with: lib_server_protos, | ||
80 | sources: wl_protos_headers, | ||
81 | ) | ||