| 1 | util_ss.add(files( |
| 2 | 'opts-visitor.c', |
| 3 | 'qapi-clone-visitor.c', |
| 4 | 'qapi-dealloc-visitor.c', |
| 5 | 'qapi-forward-visitor.c', |
| 6 | 'qapi-util.c', |
| 7 | 'qapi-visit-core.c', |
| 8 | 'qobject-input-visitor.c', |
| 9 | 'qobject-output-visitor.c', |
| 10 | 'string-input-visitor.c', |
| 11 | 'string-output-visitor.c', |
| 12 | )) |
| 13 | if have_system |
| 14 | util_ss.add(files('qapi-type-helpers.c')) |
| 15 | endif |
| 16 | if have_system or have_tools or have_ga |
| 17 | util_ss.add(files( |
| 18 | 'qmp-dispatch.c', |
| 19 | 'qmp-event.c', |
| 20 | 'qmp-registry.c', |
| 21 | )) |
| 22 | endif |
| 23 | |
| 24 | qapi_all_modules = [ |
| 25 | 'authz', |
| 26 | 'block', |
| 27 | 'block-core', |
| 28 | 'block-export', |
| 29 | 'char', |
| 30 | 'common', |
| 31 | 'compat', |
| 32 | 'control', |
| 33 | 'crypto', |
| 34 | 'cxl', |
| 35 | 'dump', |
| 36 | 'ebpf', |
| 37 | 'error', |
| 38 | 'introspect', |
| 39 | 'job', |
| 40 | 'machine-common', |
| 41 | 'machine', |
| 42 | 'machine-s390x', |
| 43 | 'migration', |
| 44 | 'misc', |
| 45 | 'net', |
| 46 | 'pragma', |
| 47 | 'qom', |
| 48 | 'replay', |
| 49 | 'run-state', |
| 50 | 'sockets', |
| 51 | 'stats', |
| 52 | 'trace', |
| 53 | 'transaction', |
| 54 | 'vfio', |
| 55 | 'virtio', |
| 56 | 'yank', |
| 57 | ] |
| 58 | if have_system |
| 59 | qapi_all_modules += [ |
| 60 | 'accelerator', |
| 61 | 'acpi', |
| 62 | 'acpi-hest', |
| 63 | 'audio', |
| 64 | 'cryptodev', |
| 65 | 'qdev', |
| 66 | 'pci', |
| 67 | 'rocker', |
| 68 | 'misc-arm', |
| 69 | 'misc-i386', |
| 70 | 'tpm', |
| 71 | 'uefi', |
| 72 | ] |
| 73 | endif |
| 74 | if have_system or have_tools |
| 75 | qapi_all_modules += [ |
| 76 | 'ui', |
| 77 | ] |
| 78 | endif |
| 79 | |
| 80 | qapi_nonmodule_outputs = [ |
| 81 | 'qapi-introspect.c', 'qapi-introspect.h', |
| 82 | 'qapi-types.c', 'qapi-types.h', |
| 83 | 'qapi-visit.h', 'qapi-visit.c', |
| 84 | 'qapi-commands.h', 'qapi-commands.c', |
| 85 | 'qapi-init-commands.h', 'qapi-init-commands.c', |
| 86 | 'qapi-events.h', 'qapi-events.c', |
| 87 | 'qapi-emit-events.c', 'qapi-emit-events.h', |
| 88 | ] |
| 89 | |
| 90 | qapi_outputs = qapi_nonmodule_outputs + [ |
| 91 | 'qapi-builtin-types.c', 'qapi-builtin-visit.c', |
| 92 | 'qapi-builtin-types.h', 'qapi-builtin-visit.h', |
| 93 | ] |
| 94 | |
| 95 | qapi_inputs = [] |
| 96 | foreach module : qapi_all_modules |
| 97 | qapi_inputs += [ files(module + '.json') ] |
| 98 | qapi_module_outputs = [ |
| 99 | 'qapi-types-@0@.c'.format(module), |
| 100 | 'qapi-types-@0@.h'.format(module), |
| 101 | 'qapi-visit-@0@.c'.format(module), |
| 102 | 'qapi-visit-@0@.h'.format(module), |
| 103 | ] |
| 104 | if have_system or have_tools |
| 105 | qapi_module_outputs += [ |
| 106 | 'qapi-events-@0@.c'.format(module), |
| 107 | 'qapi-events-@0@.h'.format(module), |
| 108 | 'qapi-commands-@0@.c'.format(module), |
| 109 | 'qapi-commands-@0@.h'.format(module), |
| 110 | 'qapi-commands-@0@.trace-events'.format(module), |
| 111 | ] |
| 112 | endif |
| 113 | qapi_outputs += qapi_module_outputs |
| 114 | endforeach |
| 115 | |
| 116 | qapi_files = custom_target('shared QAPI source files', |
| 117 | output: qapi_outputs, |
| 118 | input: [ files('qapi-schema.json') ], |
| 119 | command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ], |
| 120 | depend_files: [ qapi_inputs, qapi_gen_depends ]) |
| 121 | |
| 122 | i = 0 |
| 123 | foreach output : qapi_outputs |
| 124 | if output.endswith('.h') |
| 125 | genh += qapi_files[i] |
| 126 | endif |
| 127 | if output.endswith('.trace-events') |
| 128 | qapi_trace_events += qapi_files[i] |
| 129 | endif |
| 130 | util_ss.add(qapi_files[i]) |
| 131 | i = i + 1 |
| 132 | endforeach |