2019-07-18 14:19:02 +03:00
|
|
|
qga_qapi_outputs = [
|
|
|
|
'qga-qapi-commands.c',
|
|
|
|
'qga-qapi-commands.h',
|
|
|
|
'qga-qapi-emit-events.c',
|
|
|
|
'qga-qapi-emit-events.h',
|
|
|
|
'qga-qapi-events.c',
|
|
|
|
'qga-qapi-events.h',
|
|
|
|
'qga-qapi-init-commands.c',
|
|
|
|
'qga-qapi-init-commands.h',
|
|
|
|
'qga-qapi-introspect.c',
|
|
|
|
'qga-qapi-introspect.h',
|
|
|
|
'qga-qapi-types.c',
|
|
|
|
'qga-qapi-types.h',
|
|
|
|
'qga-qapi-visit.c',
|
|
|
|
'qga-qapi-visit.h',
|
|
|
|
]
|
|
|
|
|
|
|
|
qga_qapi_files = custom_target('QGA QAPI files',
|
2020-09-25 19:23:03 +03:00
|
|
|
output: qga_qapi_outputs,
|
2019-07-18 14:19:02 +03:00
|
|
|
input: 'qapi-schema.json',
|
|
|
|
command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@' ],
|
|
|
|
depend_files: qapi_gen_depends)
|
2020-08-05 14:07:48 +03:00
|
|
|
|
2019-07-18 14:19:02 +03:00
|
|
|
qga_ss = ss.source_set()
|
2020-08-05 14:07:48 +03:00
|
|
|
i = 0
|
|
|
|
foreach output: qga_qapi_outputs
|
|
|
|
qga_ss.add(qga_qapi_files[i])
|
|
|
|
i = i + 1
|
|
|
|
endforeach
|
|
|
|
|
2019-07-18 14:19:02 +03:00
|
|
|
qga_ss.add(files(
|
|
|
|
'commands.c',
|
|
|
|
'guest-agent-command-state.c',
|
|
|
|
'main.c',
|
|
|
|
))
|
|
|
|
qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
|
|
|
|
'channel-posix.c',
|
|
|
|
'commands-posix.c'))
|
|
|
|
qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
|
|
|
|
'channel-win32.c',
|
|
|
|
'commands-win32.c',
|
|
|
|
'service-win32.c',
|
|
|
|
'vss-win32.c'
|
|
|
|
))
|
|
|
|
|
|
|
|
qga_ss = qga_ss.apply(config_host, strict: false)
|
|
|
|
|
|
|
|
qga = executable('qemu-ga', qga_ss.sources(),
|
|
|
|
link_args: config_host['LIBS_QGA'].split(),
|
|
|
|
dependencies: [qemuutil, libudev],
|
|
|
|
install: true)
|
2020-01-28 17:06:16 +03:00
|
|
|
all_qga = [qga]
|
2019-07-15 10:39:13 +03:00
|
|
|
|
|
|
|
if targetos == 'windows'
|
|
|
|
if 'CONFIG_QGA_VSS' in config_host
|
|
|
|
subdir('vss-win32')
|
2019-07-15 12:06:20 +03:00
|
|
|
else
|
|
|
|
gen_tlb = []
|
|
|
|
endif
|
|
|
|
|
|
|
|
wixl = find_program('wixl', required: false)
|
|
|
|
if wixl.found()
|
|
|
|
deps = [gen_tlb, qga]
|
|
|
|
if 'CONFIG_QGA_VSS' in config_host and 'QEMU_GA_MSI_WITH_VSS' in config_host
|
|
|
|
deps += qga_vss
|
|
|
|
endif
|
|
|
|
qga_msi = custom_target('QGA MSI',
|
|
|
|
input: files('installer/qemu-ga.wxs'),
|
|
|
|
output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']),
|
|
|
|
depends: deps,
|
|
|
|
command: [
|
2020-09-11 15:42:47 +03:00
|
|
|
find_program('env'),
|
2019-07-15 12:06:20 +03:00
|
|
|
'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
|
|
|
|
'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
|
|
|
|
'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
|
|
|
|
'BUILD_DIR=' + meson.build_root(),
|
|
|
|
wixl, '-o', '@OUTPUT0@', '@INPUT0@',
|
|
|
|
config_host['QEMU_GA_MSI_ARCH'].split(),
|
|
|
|
config_host['QEMU_GA_MSI_WITH_VSS'].split(),
|
|
|
|
config_host['QEMU_GA_MSI_MINGW_DLL_PATH'].split(),
|
|
|
|
])
|
2020-01-28 17:06:16 +03:00
|
|
|
all_qga += [qga_msi]
|
2019-07-15 12:06:20 +03:00
|
|
|
alias_target('msi', qga_msi)
|
2019-07-15 10:39:13 +03:00
|
|
|
endif
|
2020-08-26 16:06:21 +03:00
|
|
|
else
|
|
|
|
install_subdir('run', install_dir: get_option('localstatedir'))
|
2019-07-15 10:39:13 +03:00
|
|
|
endif
|
2020-01-28 17:06:16 +03:00
|
|
|
|
|
|
|
alias_target('qemu-ga', all_qga)
|