mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-05-04 18:22:08 +00:00
Linking code from multiple separate QAPI schemata into the same program is possible, but involves some weirdness around built-in types: * We generate code for built-in types into .c only with option --builtins. The user is responsible for generating code for exactly one QAPI schema per program with --builtins. * We generate code for built-in types into .h regardless of --builtins, but guarded by #ifndef QAPI_VISIT_BUILTIN. Because all copies of this code are exactly the same, including any combination of these headers works. Replace this contraption by something more conventional: generate code for built-in types into their very own files: qapi-builtin-types.c, qapi-builtin-visit.c, qapi-builtin-types.h, qapi-builtin-visit.h, but only with --builtins. Obey --output-dir, but ignore --prefix for them. Make qapi-types.h include qapi-builtin-types.h. With multiple schemata you now have multiple qapi-types.[ch], but only one qapi-builtin-types.[ch]. Same for qapi-visit.[ch] and qapi-builtin-visit.[ch]. Bonus: if all you need is built-in stuff, you can include a much smaller header. To be exploited shortly. Backports commit cdb6610ae4283720037bae2af1f78bd40eb5fe71 from qemu |
||
---|---|---|
.. | ||
aarch64-softmmu | ||
aarch64eb-softmmu | ||
arm-softmmu | ||
armeb-softmmu | ||
m68k-softmmu | ||
mips-softmmu | ||
mips64-softmmu | ||
mips64el-softmmu | ||
mipsel-softmmu | ||
sparc-softmmu | ||
sparc64-softmmu | ||
unicorn | ||
unicorn_static | ||
x86_64-softmmu | ||
config-host.h | ||
prebuild_script.bat | ||
qapi-builtin-types.c | ||
qapi-builtin-types.h | ||
qapi-builtin-visit.c | ||
qapi-builtin-visit.h | ||
qapi-types.c | ||
qapi-types.h | ||
qapi-visit.c | ||
qapi-visit.h |