3 'qapi-clone-visitor.c',
4 'qapi-dealloc-visitor.c',
5 'qapi-forward-visitor.c',
8 'qobject-input-visitor.c',
9 'qobject-output-visitor.c',
10 'string-input-visitor.c',
11 'string-output-visitor.c',
14 util_ss.add(files('qapi-type-helpers.c'))
16 if have_system or have_tools
65 if have_system or have_tools
71 qapi_storage_daemon_modules = [
86 qapi_nonmodule_outputs = [
87 'qapi-introspect.c', 'qapi-introspect.h',
88 'qapi-types.c', 'qapi-types.h',
89 'qapi-visit.h', 'qapi-visit.c',
90 'qapi-commands.h', 'qapi-commands.c',
91 'qapi-init-commands.h', 'qapi-init-commands.c',
92 'qapi-events.h', 'qapi-events.c',
93 'qapi-emit-events.c', 'qapi-emit-events.h',
96 # First build all sources
98 'qapi-builtin-types.c', 'qapi-builtin-visit.c',
99 'qapi-builtin-types.h', 'qapi-builtin-visit.h',
103 qapi_specific_outputs = []
104 foreach module : qapi_all_modules
105 qapi_inputs += [ files(module + '.json') ]
106 qapi_module_outputs = [
107 'qapi-types-@0@.c'.format(module),
108 'qapi-types-@0@.h'.format(module),
109 'qapi-visit-@0@.c'.format(module),
110 'qapi-visit-@0@.h'.format(module),
112 if have_system or have_tools
113 qapi_module_outputs += [
114 'qapi-events-@0@.c'.format(module),
115 'qapi-events-@0@.h'.format(module),
116 'qapi-commands-@0@.c'.format(module),
117 'qapi-commands-@0@.h'.format(module),
118 'qapi-commands-@0@.trace-events'.format(module),
121 if module.endswith('-target')
122 qapi_specific_outputs += qapi_module_outputs
124 qapi_util_outputs += qapi_module_outputs
128 qapi_files = custom_target('shared QAPI source files',
129 output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs,
130 input: [ files('qapi-schema.json') ],
131 command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
132 depend_files: [ qapi_inputs, qapi_gen_depends ])
134 # Now go through all the outputs and add them to the right sourceset.
135 # These loops must be synchronized with the output of the above custom target.
138 foreach output : qapi_util_outputs
139 if output.endswith('.h')
140 genh += qapi_files[i]
142 if output.endswith('.trace-events')
143 qapi_trace_events += qapi_files[i]
145 util_ss.add(qapi_files[i])
149 foreach output : qapi_specific_outputs + qapi_nonmodule_outputs
150 if output.endswith('.h')
151 genh += qapi_files[i]
153 if output.endswith('.trace-events')
154 qapi_trace_events += qapi_files[i]
156 specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i])