]> Git Repo - qemu.git/blame - qga/meson.build
qga: add ssh-{add,remove}-authorized-keys
[qemu.git] / qga / meson.build
CommitLineData
f15bff25
PB
1qga_qapi_outputs = [
2 'qga-qapi-commands.c',
3 'qga-qapi-commands.h',
f15bff25
PB
4 'qga-qapi-emit-events.c',
5 'qga-qapi-emit-events.h',
6 'qga-qapi-events.c',
7 'qga-qapi-events.h',
8 'qga-qapi-init-commands.c',
9 'qga-qapi-init-commands.h',
10 'qga-qapi-introspect.c',
11 'qga-qapi-introspect.h',
12 'qga-qapi-types.c',
13 'qga-qapi-types.h',
14 'qga-qapi-visit.c',
15 'qga-qapi-visit.h',
16]
17
18qga_qapi_files = custom_target('QGA QAPI files',
db16115f 19 output: qga_qapi_outputs,
f15bff25
PB
20 input: 'qapi-schema.json',
21 command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@' ],
22 depend_files: qapi_gen_depends)
acfdaac5 23
f15bff25 24qga_ss = ss.source_set()
acfdaac5
PB
25i = 0
26foreach output: qga_qapi_outputs
27 qga_ss.add(qga_qapi_files[i])
28 i = i + 1
29endforeach
acfdaac5 30
f15bff25
PB
31qga_ss.add(files(
32 'commands.c',
33 'guest-agent-command-state.c',
34 'main.c',
35))
36qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
37 'channel-posix.c',
8d769ec7
MAL
38 'commands-posix.c',
39 'commands-posix-ssh.c',
40))
f15bff25
PB
41qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
42 'channel-win32.c',
43 'commands-win32.c',
44 'service-win32.c',
45 'vss-win32.c'
46))
47
48qga_ss = qga_ss.apply(config_host, strict: false)
49
50qga = executable('qemu-ga', qga_ss.sources(),
51 link_args: config_host['LIBS_QGA'].split(),
52 dependencies: [qemuutil, libudev],
53 install: true)
588a19fa 54all_qga = [qga]
7272fc72
MAL
55
56if targetos == 'windows'
57 if 'CONFIG_QGA_VSS' in config_host
58 subdir('vss-win32')
328ec32d
MAL
59 else
60 gen_tlb = []
61 endif
62
63 wixl = find_program('wixl', required: false)
64 if wixl.found()
65 deps = [gen_tlb, qga]
66 if 'CONFIG_QGA_VSS' in config_host and 'QEMU_GA_MSI_WITH_VSS' in config_host
67 deps += qga_vss
68 endif
69 qga_msi = custom_target('QGA MSI',
70 input: files('installer/qemu-ga.wxs'),
71 output: 'qemu-ga-@[email protected]'.format(config_host['ARCH']),
72 depends: deps,
73 command: [
18240fdc 74 find_program('env'),
328ec32d
MAL
75 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
76 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
77 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
78 'BUILD_DIR=' + meson.build_root(),
79 wixl, '-o', '@OUTPUT0@', '@INPUT0@',
80 config_host['QEMU_GA_MSI_ARCH'].split(),
81 config_host['QEMU_GA_MSI_WITH_VSS'].split(),
82 config_host['QEMU_GA_MSI_MINGW_DLL_PATH'].split(),
83 ])
588a19fa 84 all_qga += [qga_msi]
328ec32d 85 alias_target('msi', qga_msi)
7272fc72 86 endif
8ab1aabc
MAL
87else
88 install_subdir('run', install_dir: get_option('localstatedir'))
7272fc72 89endif
588a19fa
PB
90
91alias_target('qemu-ga', all_qga)
8d769ec7
MAL
92
93test_env = environment()
94test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
95test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
96
97# disable qga-ssh-test for now. glib's G_TEST_OPTION_ISOLATE_DIRS triggers
98# the leak detector in build-oss-fuzz Gitlab CI test. we should re-enable
99# this when an alternative is implemented or when the underlying glib
100# issue is identified/fix
101#if 'CONFIG_POSIX' in config_host
102if false
103 qga_ssh_test = executable('qga-ssh-test',
104 files('commands-posix-ssh.c'),
105 dependencies: [qemuutil],
106 c_args: ['-DQGA_BUILD_UNIT_TEST'])
107
108 test('qga-ssh-test',
109 qga_ssh_test,
110 env: test_env,
111 suite: ['unit', 'qga'])
112endif
This page took 0.063954 seconds and 4 git commands to generate.