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