]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/meson.build
hw/adc: Fix CONV bit in NPCM7XX ADC CON register
[mirror_qemu.git] / qapi / meson.build
CommitLineData
a81df1b6
PB
1util_ss.add(files(
2 'opts-visitor.c',
3 'qapi-clone-visitor.c',
4 'qapi-dealloc-visitor.c',
18fa3ebc 5 'qapi-forward-visitor.c',
a81df1b6
PB
6 'qapi-util.c',
7 'qapi-visit-core.c',
a81df1b6
PB
8 'qobject-input-visitor.c',
9 'qobject-output-visitor.c',
10 'string-input-visitor.c',
11 'string-output-visitor.c',
12))
f9429c67
DB
13if have_system
14 util_ss.add(files('qapi-type-helpers.c'))
15endif
1935e0e4
PMD
16if have_system or have_tools
17 util_ss.add(files(
18 'qmp-dispatch.c',
19 'qmp-event.c',
20 'qmp-registry.c',
21 ))
22endif
a81df1b6
PB
23
24qapi_all_modules = [
a81df1b6 25 'authz',
a81df1b6 26 'block',
5daa6bfd
KW
27 'block-core',
28 'block-export',
a81df1b6
PB
29 'char',
30 'common',
6dd75472 31 'compat',
a81df1b6
PB
32 'control',
33 'crypto',
34 'dump',
35 'error',
36 'introspect',
37 'job',
38 'machine',
39 'machine-target',
40 'migration',
41 'misc',
42 'misc-target',
43 'net',
44 'pragma',
a81df1b6 45 'qom',
43d7e1d7 46 'replay',
a81df1b6
PB
47 'run-state',
48 'sockets',
b9f88dc0 49 'stats',
a81df1b6
PB
50 'trace',
51 'transaction',
50186051 52 'yank',
a81df1b6 53]
9b45a025
PMD
54if have_system
55 qapi_all_modules += [
7fdb383d
PMD
56 'acpi',
57 'audio',
9b45a025 58 'qdev',
7fdb383d
PMD
59 'pci',
60 'rdma',
61 'rocker',
62 'tpm',
9b45a025
PMD
63 ]
64endif
c2651c0e
PMD
65if have_system or have_tools
66 qapi_all_modules += [
67 'ui',
68 ]
69endif
a81df1b6
PB
70
71qapi_storage_daemon_modules = [
72 'block-core',
5daa6bfd 73 'block-export',
a81df1b6
PB
74 'char',
75 'common',
76 'control',
77 'crypto',
78 'introspect',
79 'job',
80 'qom',
81 'sockets',
82 'pragma',
83 'transaction',
84]
85
86qapi_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',
94]
95
96# First build all sources
97qapi_util_outputs = [
98 'qapi-builtin-types.c', 'qapi-builtin-visit.c',
99 'qapi-builtin-types.h', 'qapi-builtin-visit.h',
100]
101
102qapi_inputs = []
103qapi_specific_outputs = []
104foreach 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),
a81df1b6 111 ]
a0e61807
PMD
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),
b83a80e8 118 'qapi-commands-@0@.trace-events'.format(module),
a0e61807
PMD
119 ]
120 endif
a81df1b6
PB
121 if module.endswith('-target')
122 qapi_specific_outputs += qapi_module_outputs
123 else
124 qapi_util_outputs += qapi_module_outputs
125 endif
126endforeach
127
128qapi_files = custom_target('shared QAPI source files',
4ac2ee19 129 output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs,
a81df1b6 130 input: [ files('qapi-schema.json') ],
761a1a48 131 command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
a81df1b6
PB
132 depend_files: [ qapi_inputs, qapi_gen_depends ])
133
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.
136
137i = 0
138foreach output : qapi_util_outputs
139 if output.endswith('.h')
140 genh += qapi_files[i]
141 endif
b83a80e8
VSO
142 if output.endswith('.trace-events')
143 qapi_trace_events += qapi_files[i]
144 endif
a81df1b6
PB
145 util_ss.add(qapi_files[i])
146 i = i + 1
147endforeach
148
5242523b
MAL
149foreach output : qapi_specific_outputs + qapi_nonmodule_outputs
150 if output.endswith('.h')
151 genh += qapi_files[i]
152 endif
b83a80e8
VSO
153 if output.endswith('.trace-events')
154 qapi_trace_events += qapi_files[i]
155 endif
5242523b
MAL
156 specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i])
157 i = i + 1
158endforeach