meson: generators() are sub-optimal. Replace with custom targets

This commit is contained in:
Daniel Eklöf 2019-06-05 21:10:10 +02:00
parent 58a6dc52fc
commit 450caba415
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -14,28 +14,29 @@ if backend_wayland
wscanner_prog = find_program(
wscanner.get_pkgconfig_variable('wayland_scanner'), native: true)
wayland_protocol_header = generator(
wscanner_prog,
output: '@BASENAME@.h',
arguments: ['client-header', '@INPUT@', '@OUTPUT@'])
wayland_protocol_source = generator(
wscanner_prog,
output: '@BASENAME@.c',
arguments: ['private-code', '@INPUT@', '@OUTPUT@'])
wl_proto_headers = []
wl_proto_src = []
generated_wayland_protocols = []
foreach prot : [
'../external/wlr-layer-shell-unstable-v1.xml',
wayland_protocols_datadir + '/stable/xdg-shell/xdg-shell.xml',
wayland_protocols_datadir + '/unstable/xdg-output/xdg-output-unstable-v1.xml']
generated_wayland_protocols += [
wayland_protocol_header.process(prot),
wayland_protocol_source.process(prot)]
wl_proto_headers += custom_target(
prot.underscorify() + '-client-header',
output : '@BASENAME@.h',
input : prot,
command : [wscanner_prog, 'client-header', '@INPUT@', '@OUTPUT@'])
wl_proto_src += custom_target(
prot.underscorify() + '-private-code',
output : '@BASENAME@.c',
input : prot,
command : [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@'])
endforeach
bar_wayland = declare_dependency(
sources: ['wayland.c', 'wayland.h'] + generated_wayland_protocols,
sources: ['wayland.c', 'wayland.h'] + wl_proto_src + wl_proto_headers,
dependencies: [wayland_client, wayland_cursor, cairo, cairo_ft])
bar_backends += [bar_wayland]