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 or have_ga
66 if have_system or have_tools
72 qapi_nonmodule_outputs = [
73 'qapi-introspect.c', 'qapi-introspect.h',
74 'qapi-types.c', 'qapi-types.h',
75 'qapi-visit.h', 'qapi-visit.c',
76 'qapi-commands.h', 'qapi-commands.c',
77 'qapi-init-commands.h', 'qapi-init-commands.c',
78 'qapi-events.h', 'qapi-events.c',
79 'qapi-emit-events.c', 'qapi-emit-events.h',
82 # First build all sources
84 'qapi-builtin-types.c', 'qapi-builtin-visit.c',
85 'qapi-builtin-types.h', 'qapi-builtin-visit.h',
89 qapi_specific_outputs = []
90 foreach module : qapi_all_modules
91 qapi_inputs += [ files(module + '.json') ]
92 qapi_module_outputs = [
93 'qapi-types-@0@.c'.format(module),
94 'qapi-types-@0@.h'.format(module),
95 'qapi-visit-@0@.c'.format(module),
96 'qapi-visit-@0@.h'.format(module),
98 if have_system or have_tools
99 qapi_module_outputs += [
100 'qapi-events-@0@.c'.format(module),
101 'qapi-events-@0@.h'.format(module),
102 'qapi-commands-@0@.c'.format(module),
103 'qapi-commands-@0@.h'.format(module),
104 'qapi-commands-@0@.trace-events'.format(module),
107 if module.endswith('-target')
108 qapi_specific_outputs += qapi_module_outputs
110 qapi_util_outputs += qapi_module_outputs
114 qapi_files = custom_target('shared QAPI source files',
115 output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs,
116 input: [ files('qapi-schema.json') ],
117 command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
118 depend_files: [ qapi_inputs, qapi_gen_depends ])
120 # Now go through all the outputs and add them to the right sourceset.
121 # These loops must be synchronized with the output of the above custom target.
124 foreach output : qapi_util_outputs
125 if output.endswith('.h')
126 genh += qapi_files[i]
128 if output.endswith('.trace-events')
129 qapi_trace_events += qapi_files[i]
131 util_ss.add(qapi_files[i])
135 foreach output : qapi_specific_outputs + qapi_nonmodule_outputs
136 if output.endswith('.h')
137 genh += qapi_files[i]
139 if output.endswith('.trace-events')
140 qapi_trace_events += qapi_files[i]
142 specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i])