]>
Commit | Line | Data |
---|---|---|
a81df1b6 PB |
1 | util_ss.add(files( |
2 | 'opts-visitor.c', | |
3 | 'qapi-clone-visitor.c', | |
4 | 'qapi-dealloc-visitor.c', | |
5 | 'qapi-util.c', | |
6 | 'qapi-visit-core.c', | |
7 | 'qmp-dispatch.c', | |
8 | 'qmp-event.c', | |
9 | 'qmp-registry.c', | |
10 | 'qobject-input-visitor.c', | |
11 | 'qobject-output-visitor.c', | |
12 | 'string-input-visitor.c', | |
13 | 'string-output-visitor.c', | |
14 | )) | |
15 | ||
16 | qapi_all_modules = [ | |
27c9188f | 17 | 'acpi', |
a81df1b6 PB |
18 | 'audio', |
19 | 'authz', | |
a81df1b6 | 20 | 'block', |
5daa6bfd KW |
21 | 'block-core', |
22 | 'block-export', | |
a81df1b6 PB |
23 | 'char', |
24 | 'common', | |
25 | 'control', | |
26 | 'crypto', | |
27 | 'dump', | |
28 | 'error', | |
29 | 'introspect', | |
30 | 'job', | |
31 | 'machine', | |
32 | 'machine-target', | |
33 | 'migration', | |
34 | 'misc', | |
35 | 'misc-target', | |
36 | 'net', | |
37 | 'pragma', | |
38 | 'qdev', | |
61c7f987 | 39 | 'pci', |
a81df1b6 PB |
40 | 'qom', |
41 | 'rdma', | |
43d7e1d7 | 42 | 'replay', |
a81df1b6 PB |
43 | 'rocker', |
44 | 'run-state', | |
45 | 'sockets', | |
46 | 'tpm', | |
47 | 'trace', | |
48 | 'transaction', | |
49 | 'ui', | |
50 | ] | |
51 | ||
52 | qapi_storage_daemon_modules = [ | |
53 | 'block-core', | |
5daa6bfd | 54 | 'block-export', |
a81df1b6 PB |
55 | 'char', |
56 | 'common', | |
57 | 'control', | |
58 | 'crypto', | |
59 | 'introspect', | |
60 | 'job', | |
61 | 'qom', | |
62 | 'sockets', | |
63 | 'pragma', | |
64 | 'transaction', | |
65 | ] | |
66 | ||
67 | qapi_nonmodule_outputs = [ | |
68 | 'qapi-introspect.c', 'qapi-introspect.h', | |
69 | 'qapi-types.c', 'qapi-types.h', | |
70 | 'qapi-visit.h', 'qapi-visit.c', | |
71 | 'qapi-commands.h', 'qapi-commands.c', | |
72 | 'qapi-init-commands.h', 'qapi-init-commands.c', | |
73 | 'qapi-events.h', 'qapi-events.c', | |
74 | 'qapi-emit-events.c', 'qapi-emit-events.h', | |
75 | ] | |
76 | ||
77 | # First build all sources | |
78 | qapi_util_outputs = [ | |
79 | 'qapi-builtin-types.c', 'qapi-builtin-visit.c', | |
80 | 'qapi-builtin-types.h', 'qapi-builtin-visit.h', | |
81 | ] | |
82 | ||
83 | qapi_inputs = [] | |
84 | qapi_specific_outputs = [] | |
85 | foreach module : qapi_all_modules | |
86 | qapi_inputs += [ files(module + '.json') ] | |
87 | qapi_module_outputs = [ | |
88 | 'qapi-types-@0@.c'.format(module), | |
89 | 'qapi-types-@0@.h'.format(module), | |
90 | 'qapi-visit-@0@.c'.format(module), | |
91 | 'qapi-visit-@0@.h'.format(module), | |
92 | 'qapi-events-@0@.c'.format(module), | |
93 | 'qapi-events-@0@.h'.format(module), | |
94 | 'qapi-commands-@0@.c'.format(module), | |
95 | 'qapi-commands-@0@.h'.format(module), | |
96 | ] | |
97 | if module.endswith('-target') | |
98 | qapi_specific_outputs += qapi_module_outputs | |
99 | else | |
100 | qapi_util_outputs += qapi_module_outputs | |
101 | endif | |
102 | endforeach | |
103 | ||
104 | qapi_files = custom_target('shared QAPI source files', | |
4ac2ee19 | 105 | output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs, |
a81df1b6 PB |
106 | input: [ files('qapi-schema.json') ], |
107 | command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ], | |
108 | depend_files: [ qapi_inputs, qapi_gen_depends ]) | |
109 | ||
110 | # Now go through all the outputs and add them to the right sourceset. | |
111 | # These loops must be synchronized with the output of the above custom target. | |
112 | ||
113 | i = 0 | |
114 | foreach output : qapi_util_outputs | |
115 | if output.endswith('.h') | |
116 | genh += qapi_files[i] | |
117 | endif | |
118 | util_ss.add(qapi_files[i]) | |
119 | i = i + 1 | |
120 | endforeach | |
121 | ||
5242523b MAL |
122 | foreach output : qapi_specific_outputs + qapi_nonmodule_outputs |
123 | if output.endswith('.h') | |
124 | genh += qapi_files[i] | |
125 | endif | |
126 | specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i]) | |
127 | i = i + 1 | |
128 | endforeach |