]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/meson.build
9pfs: refactor 'name_idx' -> 'nwalked' in v9fs_walk()
[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',
a81df1b6
PB
49 'trace',
50 'transaction',
50186051 51 'yank',
a81df1b6 52]
9b45a025
PMD
53if have_system
54 qapi_all_modules += [
7fdb383d
PMD
55 'acpi',
56 'audio',
9b45a025 57 'qdev',
7fdb383d
PMD
58 'pci',
59 'rdma',
60 'rocker',
61 'tpm',
9b45a025
PMD
62 ]
63endif
c2651c0e
PMD
64if have_system or have_tools
65 qapi_all_modules += [
66 'ui',
67 ]
68endif
a81df1b6
PB
69
70qapi_storage_daemon_modules = [
71 'block-core',
5daa6bfd 72 'block-export',
a81df1b6
PB
73 'char',
74 'common',
75 'control',
76 'crypto',
77 'introspect',
78 'job',
79 'qom',
80 'sockets',
81 'pragma',
82 'transaction',
83]
84
85qapi_nonmodule_outputs = [
86 'qapi-introspect.c', 'qapi-introspect.h',
87 'qapi-types.c', 'qapi-types.h',
88 'qapi-visit.h', 'qapi-visit.c',
89 'qapi-commands.h', 'qapi-commands.c',
90 'qapi-init-commands.h', 'qapi-init-commands.c',
91 'qapi-events.h', 'qapi-events.c',
92 'qapi-emit-events.c', 'qapi-emit-events.h',
93]
94
95# First build all sources
96qapi_util_outputs = [
97 'qapi-builtin-types.c', 'qapi-builtin-visit.c',
98 'qapi-builtin-types.h', 'qapi-builtin-visit.h',
99]
100
101qapi_inputs = []
102qapi_specific_outputs = []
103foreach module : qapi_all_modules
104 qapi_inputs += [ files(module + '.json') ]
105 qapi_module_outputs = [
106 'qapi-types-@0@.c'.format(module),
107 'qapi-types-@0@.h'.format(module),
108 'qapi-visit-@0@.c'.format(module),
109 'qapi-visit-@0@.h'.format(module),
a81df1b6 110 ]
a0e61807
PMD
111 if have_system or have_tools
112 qapi_module_outputs += [
113 'qapi-events-@0@.c'.format(module),
114 'qapi-events-@0@.h'.format(module),
115 'qapi-commands-@0@.c'.format(module),
116 'qapi-commands-@0@.h'.format(module),
b83a80e8 117 'qapi-commands-@0@.trace-events'.format(module),
a0e61807
PMD
118 ]
119 endif
a81df1b6
PB
120 if module.endswith('-target')
121 qapi_specific_outputs += qapi_module_outputs
122 else
123 qapi_util_outputs += qapi_module_outputs
124 endif
125endforeach
126
127qapi_files = custom_target('shared QAPI source files',
4ac2ee19 128 output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs,
a81df1b6 129 input: [ files('qapi-schema.json') ],
761a1a48 130 command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
a81df1b6
PB
131 depend_files: [ qapi_inputs, qapi_gen_depends ])
132
133# Now go through all the outputs and add them to the right sourceset.
134# These loops must be synchronized with the output of the above custom target.
135
136i = 0
137foreach output : qapi_util_outputs
138 if output.endswith('.h')
139 genh += qapi_files[i]
140 endif
b83a80e8
VSO
141 if output.endswith('.trace-events')
142 qapi_trace_events += qapi_files[i]
143 endif
a81df1b6
PB
144 util_ss.add(qapi_files[i])
145 i = i + 1
146endforeach
147
5242523b
MAL
148foreach output : qapi_specific_outputs + qapi_nonmodule_outputs
149 if output.endswith('.h')
150 genh += qapi_files[i]
151 endif
b83a80e8
VSO
152 if output.endswith('.trace-events')
153 qapi_trace_events += qapi_files[i]
154 endif
5242523b
MAL
155 specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i])
156 i = i + 1
157endforeach