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
69 if have_system or have_tools
75 qapi_nonmodule_outputs = [
76 'qapi-introspect.c', 'qapi-introspect.h',
77 'qapi-types.c', 'qapi-types.h',
78 'qapi-visit.h', 'qapi-visit.c',
79 'qapi-commands.h', 'qapi-commands.c',
80 'qapi-init-commands.h', 'qapi-init-commands.c',
81 'qapi-events.h', 'qapi-events.c',
82 'qapi-emit-events.c', 'qapi-emit-events.h',
85 # First build all sources
87 'qapi-builtin-types.c', 'qapi-builtin-visit.c',
88 'qapi-builtin-types.h', 'qapi-builtin-visit.h',
92 qapi_specific_outputs = []
93 foreach module : qapi_all_modules
94 qapi_inputs += [ files(module + '.json') ]
95 qapi_module_outputs = [
96 'qapi-types-@0@.c'.format(module),
97 'qapi-types-@0@.h'.format(module),
98 'qapi-visit-@0@.c'.format(module),
99 'qapi-visit-@0@.h'.format(module),
101 if have_system or have_tools
102 qapi_module_outputs += [
103 'qapi-events-@0@.c'.format(module),
104 'qapi-events-@0@.h'.format(module),
105 'qapi-commands-@0@.c'.format(module),
106 'qapi-commands-@0@.h'.format(module),
107 'qapi-commands-@0@.trace-events'.format(module),
110 if module.endswith('-target')
111 qapi_specific_outputs += qapi_module_outputs
113 qapi_util_outputs += qapi_module_outputs
117 qapi_files = custom_target('shared QAPI source files',
118 output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs,
119 input: [ files('qapi-schema.json') ],
120 command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
121 depend_files: [ qapi_inputs, qapi_gen_depends ])
123 # Now go through all the outputs and add them to the right sourceset.
124 # These loops must be synchronized with the output of the above custom target.
127 foreach output : qapi_util_outputs
128 if output.endswith('.h')
129 genh += qapi_files[i]
131 if output.endswith('.trace-events')
132 qapi_trace_events += qapi_files[i]
134 util_ss.add(qapi_files[i])
138 foreach output : qapi_specific_outputs + qapi_nonmodule_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 specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: qapi_files[i])