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