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 depend_files: qapi_gen_depends)
31 qga_ss = ss.source_set()
32 qga_ss.add(qga_qapi_files.to_list())
35 'guest-agent-command-state.c',
38 qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
41 'commands-posix-ssh.c',
43 qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
50 qga_ss = qga_ss.apply(config_host, strict: false)
52 qga = executable('qemu-ga', qga_ss.sources(),
53 link_args: config_host['LIBS_QGA'].split(),
54 dependencies: [qemuutil, libudev],
58 if targetos == 'windows'
59 if 'CONFIG_QGA_VSS' in config_host
66 'x86': ['-D', 'Arch=32'],
67 'x86_64': ['-a', 'x64', '-D', 'Arch=64']
70 if cpu in qemu_ga_msi_arch
71 wixl = find_program('wixl', required: get_option('guest_agent_msi'))
72 elif get_option('guest_agent_msi').enabled()
73 error('CPU not supported for building guest agent installation package')
79 if 'CONFIG_QGA_VSS' in config_host
80 qemu_ga_msi_vss = ['-D', 'InstallVss']
83 qga_msi = custom_target('QGA MSI',
84 input: files('installer/qemu-ga.wxs'),
85 output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']),
89 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
90 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
91 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
92 'BUILD_DIR=' + meson.build_root(),
93 wixl, '-o', '@OUTPUT0@', '@INPUT0@',
94 qemu_ga_msi_arch[cpu],
96 '-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
99 alias_target('msi', qga_msi)
102 if get_option('guest_agent_msi').enabled()
103 error('MSI guest agent package is available only for MinGW Windows cross-compilation')
105 install_subdir('run', install_dir: get_option('localstatedir'))
108 alias_target('qemu-ga', all_qga)
110 test_env = environment()
111 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
112 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
114 # disable qga-ssh-test for now. glib's G_TEST_OPTION_ISOLATE_DIRS triggers
115 # the leak detector in build-oss-fuzz Gitlab CI test. we should re-enable
116 # this when an alternative is implemented or when the underlying glib
117 # issue is identified/fix
118 #if 'CONFIG_POSIX' in config_host
120 srcs = [files('commands-posix-ssh.c')]
122 foreach output: qga_qapi_outputs
123 if output.startswith('qga-qapi-types') or output.startswith('qga-qapi-visit')
124 srcs += qga_qapi_files[i]
128 qga_ssh_test = executable('qga-ssh-test', srcs,
129 dependencies: [qemuutil],
130 c_args: ['-DQGA_BUILD_UNIT_TEST'])
135 suite: ['unit', 'qga'])