4 'qga-qapi-emit-events.c',
5 'qga-qapi-emit-events.h',
8 'qga-qapi-init-commands.c',
9 'qga-qapi-init-commands.h',
10 'qga-qapi-introspect.c',
11 'qga-qapi-introspect.h',
18 # Problem: to generate trace events, we'd have to add the .trace-events
19 # file to qapi_trace_events like we do in qapi/meson.build. Since
20 # qapi_trace_events is used by trace/meson.build, we'd have to move
21 # subdir('qga') above subdir('trace') in the top-level meson.build.
22 # Can't, because it would break the dependency of qga on qemuutil (which
23 # depends on trace_ss). Not worth solving now; simply suppress trace
24 # event generation instead.
25 qga_qapi_files = custom_target('QGA QAPI files',
26 output: qga_qapi_outputs,
27 input: 'qapi-schema.json',
28 command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@',
29 '--suppress-tracing' ],
30 depend_files: qapi_gen_depends)
32 qga_ss = ss.source_set()
33 qga_ss.add(qga_qapi_files.to_list())
36 'guest-agent-command-state.c',
39 qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
42 'commands-posix-ssh.c',
44 qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
51 qga_ss = qga_ss.apply(config_host, strict: false)
53 qga = executable('qemu-ga', qga_ss.sources(),
54 link_args: config_host['LIBS_QGA'].split(),
55 dependencies: [qemuutil, libudev],
59 if targetos == 'windows'
60 if 'CONFIG_QGA_VSS' in config_host
67 'x86': ['-D', 'Arch=32'],
68 'x86_64': ['-a', 'x64', '-D', 'Arch=64']
71 if cpu in qemu_ga_msi_arch
72 wixl = find_program('wixl', required: get_option('guest_agent_msi'))
73 elif get_option('guest_agent_msi').enabled()
74 error('CPU not supported for building guest agent installation package')
80 if 'CONFIG_QGA_VSS' in config_host
81 qemu_ga_msi_vss = ['-D', 'InstallVss']
84 qga_msi = custom_target('QGA MSI',
85 input: files('installer/qemu-ga.wxs'),
86 output: 'qemu-ga-@0@.msi'.format(host_arch),
90 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
91 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
92 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
93 'BUILD_DIR=' + meson.build_root(),
94 wixl, '-o', '@OUTPUT0@', '@INPUT0@',
95 qemu_ga_msi_arch[cpu],
97 '-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
100 alias_target('msi', qga_msi)
103 if get_option('guest_agent_msi').enabled()
104 error('MSI guest agent package is available only for MinGW Windows cross-compilation')
106 install_subdir('run', install_dir: get_option('localstatedir'))
109 alias_target('qemu-ga', all_qga)
111 test_env = environment()
112 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
113 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
115 # disable qga-ssh-test for now. glib's G_TEST_OPTION_ISOLATE_DIRS triggers
116 # the leak detector in build-oss-fuzz Gitlab CI test. we should re-enable
117 # this when an alternative is implemented or when the underlying glib
118 # issue is identified/fix
119 #if 'CONFIG_POSIX' in config_host
121 srcs = [files('commands-posix-ssh.c')]
123 foreach output: qga_qapi_outputs
124 if output.startswith('qga-qapi-types') or output.startswith('qga-qapi-visit')
125 srcs += qga_qapi_files[i]
129 qga_ssh_test = executable('qga-ssh-test', srcs,
130 dependencies: [qemuutil],
131 c_args: ['-DQGA_BUILD_UNIT_TEST'])
136 suite: ['unit', 'qga'])