2016-11-24 18:54:51 +03:00
|
|
|
dep_scanner = dependency('wayland-scanner', native: true)
|
|
|
|
prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
|
|
|
|
|
2022-01-21 17:13:58 +03:00
|
|
|
dep_wp = dependency('wayland-protocols', version: '>= 1.26',
|
2021-11-22 16:41:23 +03:00
|
|
|
fallback: ['wayland-protocols', 'wayland_protocols'])
|
|
|
|
dir_wp_base = dep_wp.get_variable(pkgconfig: 'pkgdatadir', internal: 'pkgdatadir')
|
2016-11-24 18:54:51 +03:00
|
|
|
|
|
|
|
install_data(
|
|
|
|
[
|
2022-04-09 01:39:06 +03:00
|
|
|
'weston-content-protection.xml',
|
2016-11-24 18:54:51 +03:00
|
|
|
'weston-debug.xml',
|
2019-11-16 19:55:17 +03:00
|
|
|
'weston-direct-display.xml',
|
2020-11-03 15:26:24 +03:00
|
|
|
'weston-output-capture.xml',
|
2016-11-24 18:54:51 +03:00
|
|
|
],
|
|
|
|
install_dir: join_paths(dir_data, dir_protocol_libweston)
|
|
|
|
)
|
|
|
|
|
|
|
|
generated_protocols = [
|
2022-01-21 15:50:20 +03:00
|
|
|
[ 'input-method', 'unstable', 'v1' ],
|
|
|
|
[ 'input-timestamps', 'unstable', 'v1' ],
|
2016-11-24 18:54:51 +03:00
|
|
|
[ 'ivi-application', 'internal' ],
|
|
|
|
[ 'ivi-hmi-controller', 'internal' ],
|
2022-01-21 15:50:20 +03:00
|
|
|
[ 'fullscreen-shell', 'unstable', 'v1' ],
|
|
|
|
[ 'linux-dmabuf', 'unstable', 'v1' ],
|
|
|
|
[ 'linux-explicit-synchronization', 'unstable', 'v1' ],
|
2016-11-24 18:54:51 +03:00
|
|
|
[ 'presentation-time', 'stable' ],
|
2022-01-21 15:50:20 +03:00
|
|
|
[ 'pointer-constraints', 'unstable', 'v1' ],
|
|
|
|
[ 'relative-pointer', 'unstable', 'v1' ],
|
2022-01-21 17:13:58 +03:00
|
|
|
[ 'single-pixel-buffer', 'staging', 'v1' ],
|
2022-01-21 15:50:20 +03:00
|
|
|
[ 'tablet', 'unstable', 'v2' ],
|
2016-11-24 18:54:51 +03:00
|
|
|
[ 'text-cursor-position', 'internal' ],
|
2022-01-21 15:50:20 +03:00
|
|
|
[ 'text-input', 'unstable', 'v1' ],
|
2016-11-24 18:54:51 +03:00
|
|
|
[ 'viewporter', 'stable' ],
|
|
|
|
[ 'weston-debug', 'internal' ],
|
|
|
|
[ 'weston-desktop-shell', 'internal' ],
|
2020-11-03 15:26:24 +03:00
|
|
|
[ 'weston-output-capture', 'internal' ],
|
2019-02-04 11:34:56 +03:00
|
|
|
[ 'weston-content-protection', 'internal' ],
|
2016-11-24 18:54:51 +03:00
|
|
|
[ 'weston-test', 'internal' ],
|
|
|
|
[ 'weston-touch-calibration', 'internal' ],
|
2019-11-16 19:55:17 +03:00
|
|
|
[ 'weston-direct-display', 'internal' ],
|
2022-01-21 15:50:20 +03:00
|
|
|
[ 'xdg-output', 'unstable', 'v1' ],
|
|
|
|
[ 'xdg-shell', 'unstable', 'v6' ],
|
2018-11-29 00:46:37 +03:00
|
|
|
[ 'xdg-shell', 'stable' ],
|
2016-11-24 18:54:51 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
foreach proto: generated_protocols
|
|
|
|
proto_name = proto[0]
|
|
|
|
if proto[1] == 'internal'
|
|
|
|
base_file = proto_name
|
|
|
|
xml_path = '@0@.xml'.format(proto_name)
|
|
|
|
elif proto[1] == 'stable'
|
|
|
|
base_file = proto_name
|
|
|
|
xml_path = '@0@/stable/@1@/@1@.xml'.format(dir_wp_base, base_file)
|
2022-01-21 15:50:20 +03:00
|
|
|
elif proto[1] == 'unstable'
|
|
|
|
base_file = '@0@-unstable-@1@'.format(proto_name, proto[2])
|
2016-11-24 18:54:51 +03:00
|
|
|
xml_path = '@0@/unstable/@1@/@2@.xml'.format(dir_wp_base, proto_name, base_file)
|
2022-01-21 17:13:58 +03:00
|
|
|
elif proto[1] == 'staging'
|
|
|
|
base_file = '@0@-@1@'.format(proto_name, proto[2])
|
|
|
|
xml_path = '@0@/staging/@1@/@2@.xml'.format(dir_wp_base, proto_name, base_file)
|
2016-11-24 18:54:51 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
foreach output_type: [ 'client-header', 'server-header', 'private-code' ]
|
|
|
|
if output_type == 'client-header'
|
|
|
|
output_file = '@0@-client-protocol.h'.format(base_file)
|
|
|
|
elif output_type == 'server-header'
|
|
|
|
output_file = '@0@-server-protocol.h'.format(base_file)
|
|
|
|
else
|
|
|
|
output_file = '@0@-protocol.c'.format(base_file)
|
|
|
|
if dep_scanner.version().version_compare('< 1.14.91')
|
|
|
|
output_type = 'code'
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
var_name = output_file.underscorify()
|
|
|
|
target = custom_target(
|
|
|
|
'@0@ @1@'.format(base_file, output_type),
|
|
|
|
command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
|
|
|
|
input: xml_path,
|
|
|
|
output: output_file,
|
|
|
|
)
|
|
|
|
|
|
|
|
set_variable(var_name, target)
|
|
|
|
endforeach
|
|
|
|
endforeach
|