diff mbox series

[for-5.2] meson: Fix build with --disable-guest-agent-msi

Message ID 20201117201834.408892-1-sw@weilnetz.de (mailing list archive)
State New, archived
Headers show
Series [for-5.2] meson: Fix build with --disable-guest-agent-msi | expand

Commit Message

Stefan Weil Nov. 17, 2020, 8:18 p.m. UTC
The QGA MSI target requires several macros which are only available
without --disable-guest-agent-msi.

Don't define that target if configure was called with --disable-guest-agent-msi.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 qga/meson.build | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

Comments

Paolo Bonzini Nov. 18, 2020, 8:30 a.m. UTC | #1
On 17/11/20 21:18, Stefan Weil wrote:
> The QGA MSI target requires several macros which are only available
> without --disable-guest-agent-msi.
> 
> Don't define that target if configure was called with --disable-guest-agent-msi.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>   qga/meson.build | 36 +++++++++++++++++++-----------------
>   1 file changed, 19 insertions(+), 17 deletions(-)
> 
> diff --git a/qga/meson.build b/qga/meson.build
> index 53ba6de5f8..520af6ce9b 100644
> --- a/qga/meson.build
> +++ b/qga/meson.build
> @@ -61,23 +61,25 @@ if targetos == 'windows'
>       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: [
> -                              find_program('env'),
> -                              '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(),
> -                            ])
> -    all_qga += [qga_msi]
> -    alias_target('msi', qga_msi)
> +    if 'CONFIG_QGA_MSI' in config_host
> +      qga_msi = custom_target('QGA MSI',
> +                              input: files('installer/qemu-ga.wxs'),
> +                              output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']),
> +                              depends: deps,
> +                              command: [
> +                                find_program('env'),
> +                                '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(),
> +                              ])
> +      all_qga += [qga_msi]
> +      alias_target('msi', qga_msi)
> +    endif
>     endif
>   else
>     install_subdir('run', install_dir: get_option('localstatedir'))
> 

Queued, thanks.

Paolo
Philippe Mathieu-Daudé Nov. 18, 2020, 11:16 a.m. UTC | #2
On 11/18/20 9:30 AM, Paolo Bonzini wrote:
> On 17/11/20 21:18, Stefan Weil wrote:
>> The QGA MSI target requires several macros which are only available
>> without --disable-guest-agent-msi.
>>
>> Don't define that target if configure was called with
>> --disable-guest-agent-msi.

Can we have a CI job to avoid further regressions?

>>
>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>> ---
>>   qga/meson.build | 36 +++++++++++++++++++-----------------
>>   1 file changed, 19 insertions(+), 17 deletions(-)
>>
>> diff --git a/qga/meson.build b/qga/meson.build
>> index 53ba6de5f8..520af6ce9b 100644
>> --- a/qga/meson.build
>> +++ b/qga/meson.build
>> @@ -61,23 +61,25 @@ if targetos == 'windows'
>>       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: [
>> -                              find_program('env'),
>> -                              '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(),
>> -                            ])
>> -    all_qga += [qga_msi]
>> -    alias_target('msi', qga_msi)
>> +    if 'CONFIG_QGA_MSI' in config_host
>> +      qga_msi = custom_target('QGA MSI',
>> +                              input: files('installer/qemu-ga.wxs'),
>> +                              output:
>> 'qemu-ga-@0@.msi'.format(config_host['ARCH']),
>> +                              depends: deps,
>> +                              command: [
>> +                                find_program('env'),
>> +                                '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(),
>> +                              ])
>> +      all_qga += [qga_msi]
>> +      alias_target('msi', qga_msi)
>> +    endif
>>     endif
>>   else
>>     install_subdir('run', install_dir: get_option('localstatedir'))
>>
> 
> Queued, thanks.
> 
> Paolo
> 
>
diff mbox series

Patch

diff --git a/qga/meson.build b/qga/meson.build
index 53ba6de5f8..520af6ce9b 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -61,23 +61,25 @@  if targetos == 'windows'
     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: [
-                              find_program('env'),
-                              '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(),
-                            ])
-    all_qga += [qga_msi]
-    alias_target('msi', qga_msi)
+    if 'CONFIG_QGA_MSI' in config_host
+      qga_msi = custom_target('QGA MSI',
+                              input: files('installer/qemu-ga.wxs'),
+                              output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']),
+                              depends: deps,
+                              command: [
+                                find_program('env'),
+                                '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(),
+                              ])
+      all_qga += [qga_msi]
+      alias_target('msi', qga_msi)
+    endif
   endif
 else
   install_subdir('run', install_dir: get_option('localstatedir'))