xref: /openbmc/qemu/qga/meson.build (revision 7272fc72682c2573c67136e2c175d33d00d8905b)
1qga_qapi_outputs = [
2  'qga-qapi-commands.c',
3  'qga-qapi-commands.h',
4  'qga-qapi-doc.texi',
5  'qga-qapi-emit-events.c',
6  'qga-qapi-emit-events.h',
7  'qga-qapi-events.c',
8  'qga-qapi-events.h',
9  'qga-qapi-init-commands.c',
10  'qga-qapi-init-commands.h',
11  'qga-qapi-introspect.c',
12  'qga-qapi-introspect.h',
13  'qga-qapi-types.c',
14  'qga-qapi-types.h',
15  'qga-qapi-visit.c',
16  'qga-qapi-visit.h',
17]
18
19qga_qapi_files = custom_target('QGA QAPI files',
20                               output: qga_qapi_outputs,
21                               input: 'qapi-schema.json',
22                               command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@' ],
23                               depend_files: qapi_gen_depends)
24qga_ss = ss.source_set()
25qga_ss.add(qga_qapi_files)
26qga_ss.add(files(
27  'commands.c',
28  'guest-agent-command-state.c',
29  'main.c',
30))
31qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
32  'channel-posix.c',
33  'commands-posix.c'))
34qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
35  'channel-win32.c',
36  'commands-win32.c',
37  'service-win32.c',
38  'vss-win32.c'
39))
40
41qga_ss = qga_ss.apply(config_host, strict: false)
42
43qga = executable('qemu-ga', qga_ss.sources(),
44                 link_args: config_host['LIBS_QGA'].split(),
45                 dependencies: [qemuutil, libudev],
46                 install: true)
47
48if targetos == 'windows'
49  if 'CONFIG_QGA_VSS' in config_host
50    subdir('vss-win32')
51  endif
52endif
53