Codebase list wlroots / 39ac214
Replace generator with custom_target This stops the protocol header constantly being regenerated for every target using them. Scott Anderson 5 years ago
1 changed file(s) with 18 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
88 else
99 wayland_scanner = find_program('wayland-scanner', native: true)
1010 endif
11
12 wayland_scanner_server = generator(
13 wayland_scanner,
14 output: '@BASENAME@-protocol.h',
15 arguments: ['server-header', '@INPUT@', '@OUTPUT@'],
16 )
17
18 wayland_scanner_code = generator(
19 wayland_scanner,
20 output: '@BASENAME@-protocol.c',
21 arguments: ['private-code', '@INPUT@', '@OUTPUT@'],
22 )
23
24 wayland_scanner_client = generator(
25 wayland_scanner,
26 output: '@BASENAME@-client-protocol.h',
27 arguments: ['client-header', '@INPUT@', '@OUTPUT@'],
28 )
2911
3012 protocols = [
3113 [wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
6749
6850 foreach p : protocols
6951 xml = join_paths(p)
70 wl_protos_src += wayland_scanner_code.process(xml)
71 wl_protos_headers += wayland_scanner_server.process(xml)
52 wl_protos_src += custom_target(
53 xml.underscorify() + '_server_c',
54 input: xml,
55 output: '@BASENAME@-protocol.c',
56 command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
57 )
58 wl_protos_headers += custom_target(
59 xml.underscorify() + '_server_h',
60 input: xml,
61 output: '@BASENAME@-protocol.h',
62 command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
63 )
7264 endforeach
7365
7466 foreach p : client_protocols
7567 xml = join_paths(p)
76 wl_protos_headers += wayland_scanner_client.process(xml)
68 wl_protos_headers += custom_target(
69 xml.underscorify() + '_client_h',
70 input: xml,
71 output: '@BASENAME@-client-protocol.h',
72 command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
73 )
7774 endforeach
7875
7976 lib_wl_protos = static_library(