• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1dep_scanner = dependency('wayland-scanner', native: true)
2prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
3
4dep_wp = dependency('wayland-protocols', version: '>= 1.18')
5dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
6
7install_data(
8	[
9		'weston-debug.xml',
10		'weston-direct-display.xml',
11	],
12	install_dir: join_paths(dir_data, dir_protocol_libweston)
13)
14
15generated_protocols = [
16	[ 'input-method', 'v1' ],
17	[ 'input-timestamps', 'v1' ],
18	[ 'ivi-application', 'internal' ],
19	[ 'ivi-hmi-controller', 'internal' ],
20	[ 'fullscreen-shell', 'v1' ],
21	[ 'linux-dmabuf', 'v1' ],
22	[ 'linux-explicit-synchronization', 'v1' ],
23	[ 'presentation-time', 'stable' ],
24	[ 'pointer-constraints', 'v1' ],
25	[ 'relative-pointer', 'v1' ],
26	[ 'tablet', 'v2' ],
27	[ 'text-cursor-position', 'internal' ],
28	[ 'text-input', 'v1' ],
29	[ 'viewporter', 'stable' ],
30	[ 'weston-debug', 'internal' ],
31	[ 'weston-desktop-shell', 'internal' ],
32	[ 'weston-screenshooter', 'internal' ],
33	[ 'weston-content-protection', 'internal' ],
34	[ 'weston-test', 'internal' ],
35	[ 'weston-touch-calibration', 'internal' ],
36	[ 'weston-direct-display', 'internal' ],
37	[ 'xdg-output', 'v1' ],
38	[ 'xdg-shell', 'v6' ],
39	[ 'xdg-shell', 'stable' ],
40]
41
42foreach proto: generated_protocols
43	proto_name = proto[0]
44	if proto[1] == 'internal'
45		base_file = proto_name
46		xml_path = '@0@.xml'.format(proto_name)
47	elif proto[1] == 'stable'
48		base_file = proto_name
49		xml_path = '@0@/stable/@1@/@1@.xml'.format(dir_wp_base, base_file)
50	else
51		base_file = '@0@-unstable-@1@'.format(proto_name, proto[1])
52		xml_path = '@0@/unstable/@1@/@2@.xml'.format(dir_wp_base, proto_name, base_file)
53	endif
54
55	foreach output_type: [ 'client-header', 'server-header', 'private-code' ]
56		if output_type == 'client-header'
57			output_file = '@0@-client-protocol.h'.format(base_file)
58		elif output_type == 'server-header'
59			output_file = '@0@-server-protocol.h'.format(base_file)
60		else
61			output_file = '@0@-protocol.c'.format(base_file)
62			if dep_scanner.version().version_compare('< 1.14.91')
63				output_type = 'code'
64			endif
65		endif
66
67		var_name = output_file.underscorify()
68		target = custom_target(
69			'@0@ @1@'.format(base_file, output_type),
70			command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
71			input: xml_path,
72			output: output_file,
73		)
74
75		set_variable(var_name, target)
76	endforeach
77endforeach
78