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
70 if have_system or have_tools
76 qapi_nonmodule_outputs = [
77 'qapi-introspect.c', 'qapi-introspect.h',
78 'qapi-types.c', 'qapi-types.h',
79 'qapi-visit.h', 'qapi-visit.c',
80 'qapi-commands.h', 'qapi-commands.c',
81 'qapi-init-commands.h', 'qapi-init-commands.c',
82 'qapi-events.h', 'qapi-events.c',
83 'qapi-emit-events.c', 'qapi-emit-events.h',
86 # First build all sources
88 'qapi-builtin-types.c', 'qapi-builtin-visit.c',
89 'qapi-builtin-types.h', 'qapi-builtin-visit.h',
93 qapi_specific_outputs = []
94 foreach module : qapi_all_modules
95 qapi_inputs += [ files(module + '.json') ]
96 qapi_module_outputs = [
97 'qapi-types-@0@.c'.format(module),
98 'qapi-types-@0@.h'.format(module),
99 'qapi-visit-@0@.c'.format(module),
100 'qapi-visit-@0@.h'.format(module),
102 if have_system or have_tools
103 qapi_module_outputs += [
104 'qapi-events-@0@.c'.format(module),
105 'qapi-events-@0@.h'.format(module),
106 'qapi-commands-@0@.c'.format(module),
107 'qapi-commands-@0@.h'.format(module),
108 'qapi-commands-@0@.trace-events'.format(module),
111 if module.endswith('-target')
112 qapi_specific_outputs += qapi_module_outputs
114 qapi_util_outputs += qapi_module_outputs
118 qapi_files = custom_target('shared QAPI source files',
119 output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs,
120 input: [ files('qapi-schema.json') ],
121 command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
122 depend_files: [ qapi_inputs, qapi_gen_depends ])
124 # Now go through all the outputs and add them to the right sourceset.
125 # These loops must be synchronized with the output of the above custom target.
128 foreach output : qapi_util_outputs
129 if output.endswith('.h')
130 genh += qapi_files[i]
132 if output.endswith('.trace-events')
133 qapi_trace_events += qapi_files[i]
135 util_ss.add(qapi_files[i])
139 foreach output : qapi_specific_outputs + qapi_nonmodule_outputs
140 if output.endswith('.h')
141 genh += qapi_files[i]
143 if output.endswith('.trace-events')
144 qapi_trace_events += qapi_files[i]
146 specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: qapi_files[i])