qapi: make all generated files common

Monolithic files (qapi_nonmodule_outputs) can now be compiled just
once, so we can remove qapi_util_outputs logic.
This removes the need for any specific_ss file.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20250522190542.588267-13-pierrick.bouvier@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Pierrick Bouvier 2025-05-22 12:05:39 -07:00 committed by Markus Armbruster
parent d9cbcbff81
commit fdbb616f4d

View file

@ -85,8 +85,7 @@ qapi_nonmodule_outputs = [
'qapi-emit-events.c', 'qapi-emit-events.h',
]
# First build all sources
qapi_util_outputs = [
qapi_outputs = qapi_nonmodule_outputs + [
'qapi-builtin-types.c', 'qapi-builtin-visit.c',
'qapi-builtin-types.h', 'qapi-builtin-visit.h',
]
@ -109,20 +108,17 @@ foreach module : qapi_all_modules
'qapi-commands-@0@.trace-events'.format(module),
]
endif
qapi_util_outputs += qapi_module_outputs
qapi_outputs += qapi_module_outputs
endforeach
qapi_files = custom_target('shared QAPI source files',
output: qapi_util_outputs + qapi_nonmodule_outputs,
output: qapi_outputs,
input: [ files('qapi-schema.json') ],
command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ],
depend_files: [ qapi_inputs, qapi_gen_depends ])
# Now go through all the outputs and add them to the right sourceset.
# These loops must be synchronized with the output of the above custom target.
i = 0
foreach output : qapi_util_outputs
foreach output : qapi_outputs
if output.endswith('.h')
genh += qapi_files[i]
endif
@ -132,14 +128,3 @@ foreach output : qapi_util_outputs
util_ss.add(qapi_files[i])
i = i + 1
endforeach
foreach output : qapi_nonmodule_outputs
if output.endswith('.h')
genh += qapi_files[i]
endif
if output.endswith('.trace-events')
qapi_trace_events += qapi_files[i]
endif
specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: qapi_files[i])
i = i + 1
endforeach