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