Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 1 | qga_qapi_outputs = [ |
| 2 | 'qga-qapi-commands.c', |
| 3 | 'qga-qapi-commands.h', |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 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 | |
| 18 | qga_qapi_files = custom_target('QGA QAPI files', |
Peter Maydell | db16115 | 2020-09-25 17:23:03 +0100 | [diff] [blame] | 19 | output: qga_qapi_outputs, |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 20 | input: 'qapi-schema.json', |
| 21 | command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@' ], |
| 22 | depend_files: qapi_gen_depends) |
Paolo Bonzini | acfdaac | 2020-08-05 13:07:48 +0200 | [diff] [blame] | 23 | |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 24 | qga_ss = ss.source_set() |
Paolo Bonzini | acfdaac | 2020-08-05 13:07:48 +0200 | [diff] [blame] | 25 | i = 0 |
| 26 | foreach output: qga_qapi_outputs |
| 27 | qga_ss.add(qga_qapi_files[i]) |
| 28 | i = i + 1 |
| 29 | endforeach |
Paolo Bonzini | acfdaac | 2020-08-05 13:07:48 +0200 | [diff] [blame] | 30 | |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 31 | qga_ss.add(files( |
| 32 | 'commands.c', |
| 33 | 'guest-agent-command-state.c', |
| 34 | 'main.c', |
| 35 | )) |
| 36 | qga_ss.add(when: 'CONFIG_POSIX', if_true: files( |
| 37 | 'channel-posix.c', |
| 38 | 'commands-posix.c')) |
| 39 | qga_ss.add(when: 'CONFIG_WIN32', if_true: files( |
| 40 | 'channel-win32.c', |
| 41 | 'commands-win32.c', |
| 42 | 'service-win32.c', |
| 43 | 'vss-win32.c' |
| 44 | )) |
| 45 | |
| 46 | qga_ss = qga_ss.apply(config_host, strict: false) |
| 47 | |
| 48 | qga = executable('qemu-ga', qga_ss.sources(), |
| 49 | link_args: config_host['LIBS_QGA'].split(), |
| 50 | dependencies: [qemuutil, libudev], |
| 51 | install: true) |
Paolo Bonzini | 588a19f | 2020-01-28 15:06:16 +0100 | [diff] [blame] | 52 | all_qga = [qga] |
Marc-André Lureau | 7272fc7 | 2019-07-15 11:39:13 +0400 | [diff] [blame] | 53 | |
| 54 | if targetos == 'windows' |
| 55 | if 'CONFIG_QGA_VSS' in config_host |
| 56 | subdir('vss-win32') |
Marc-André Lureau | 328ec32 | 2019-07-15 13:06:20 +0400 | [diff] [blame] | 57 | else |
| 58 | gen_tlb = [] |
| 59 | endif |
| 60 | |
| 61 | wixl = find_program('wixl', required: false) |
| 62 | if wixl.found() |
| 63 | deps = [gen_tlb, qga] |
| 64 | if 'CONFIG_QGA_VSS' in config_host and 'QEMU_GA_MSI_WITH_VSS' in config_host |
| 65 | deps += qga_vss |
| 66 | endif |
| 67 | qga_msi = custom_target('QGA MSI', |
| 68 | input: files('installer/qemu-ga.wxs'), |
| 69 | output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']), |
| 70 | depends: deps, |
| 71 | command: [ |
Marc-André Lureau | 18240fd | 2020-09-11 14:42:47 +0200 | [diff] [blame] | 72 | find_program('env'), |
Marc-André Lureau | 328ec32 | 2019-07-15 13:06:20 +0400 | [diff] [blame] | 73 | 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'], |
| 74 | 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'], |
| 75 | 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'], |
| 76 | 'BUILD_DIR=' + meson.build_root(), |
| 77 | wixl, '-o', '@OUTPUT0@', '@INPUT0@', |
| 78 | config_host['QEMU_GA_MSI_ARCH'].split(), |
| 79 | config_host['QEMU_GA_MSI_WITH_VSS'].split(), |
| 80 | config_host['QEMU_GA_MSI_MINGW_DLL_PATH'].split(), |
| 81 | ]) |
Paolo Bonzini | 588a19f | 2020-01-28 15:06:16 +0100 | [diff] [blame] | 82 | all_qga += [qga_msi] |
Marc-André Lureau | 328ec32 | 2019-07-15 13:06:20 +0400 | [diff] [blame] | 83 | alias_target('msi', qga_msi) |
Marc-André Lureau | 7272fc7 | 2019-07-15 11:39:13 +0400 | [diff] [blame] | 84 | endif |
Marc-André Lureau | 8ab1aab | 2020-08-26 17:06:21 +0400 | [diff] [blame] | 85 | else |
| 86 | install_subdir('run', install_dir: get_option('localstatedir')) |
Marc-André Lureau | 7272fc7 | 2019-07-15 11:39:13 +0400 | [diff] [blame] | 87 | endif |
Paolo Bonzini | 588a19f | 2020-01-28 15:06:16 +0100 | [diff] [blame] | 88 | |
| 89 | alias_target('qemu-ga', all_qga) |