[Spice-devel] [PATCH v7 13/20] build: Do not build usbredir dependent file is usbredir disabled

Victor Toso victortoso at redhat.com
Thu Sep 19 08:32:33 UTC 2019


Hi,

On Mon, Sep 16, 2019 at 12:20:56PM +0200, Victor Toso wrote:
> From: Frediano Ziglio <fziglio at redhat.com>
> 
> These files would end up to compile empty code, no reason
> to compile and link them.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

Acked-by: Victor Toso <victortoso at redhat.com>

> ---
>  src/meson.build   | 10 +++++-----
>  src/usb-backend.c |  4 ----
>  src/usbutil.c     |  3 ---
>  src/usbutil.h     |  4 ----
>  4 files changed, 5 insertions(+), 16 deletions(-)
> 
> diff --git a/src/meson.build b/src/meson.build
> index 00eb277..0461dea 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -119,11 +119,6 @@ spice_client_glib_sources = [
>    'spice-uri-priv.h',
>    'spice-util-priv.h',
>    'usb-device-manager-priv.h',
> -  'usbutil.c',
> -  'usbutil.h',
> -  'usb-backend.c',
> -  'usb-emulation.h',
> -  'usb-backend.h',
>    'vmcstream.c',
>    'vmcstream.h',
>  ]
> @@ -159,6 +154,11 @@ endif
>  
>  if spice_gtk_has_usbredir
>    spice_client_glib_sources += [
> +    'usbutil.c',
> +    'usbutil.h',
> +    'usb-backend.c',
> +    'usb-emulation.h',
> +    'usb-backend.h',
>      'usb-device-cd.c',
>      'usb-device-cd.h',
>      'cd-scsi.c',
> diff --git a/src/usb-backend.c b/src/usb-backend.c
> index 81d7c9e..3a5a873 100644
> --- a/src/usb-backend.c
> +++ b/src/usb-backend.c
> @@ -22,8 +22,6 @@
>  
>  #include "config.h"
>  
> -#ifdef USE_USBREDIR
> -
>  #include <glib-object.h>
>  #include <inttypes.h>
>  #include <gio/gio.h>
> @@ -1522,5 +1520,3 @@ spice_usb_backend_create_emulated_device(SpiceUsbBackend *be,
>  
>      return TRUE;
>  }
> -
> -#endif /* USB_REDIR */
> diff --git a/src/usbutil.c b/src/usbutil.c
> index 5052ef3..aebed35 100644
> --- a/src/usbutil.c
> +++ b/src/usbutil.c
> @@ -26,7 +26,6 @@
>  #include <ctype.h>
>  #include <stdlib.h>
>  
> -#ifdef USE_USBREDIR
>  #include <stdio.h>
>  #ifdef __linux__
>  #include <unistd.h>
> @@ -275,8 +274,6 @@ void spice_usb_util_get_device_strings(int bus, int address,
>      }
>  }
>  
> -#endif
> -
>  #ifdef USBUTIL_TEST
>  int main()
>  {
> diff --git a/src/usbutil.h b/src/usbutil.h
> index 6c570d9..2f683fa 100644
> --- a/src/usbutil.h
> +++ b/src/usbutil.h
> @@ -21,8 +21,6 @@
>  #pragma once
>  
>  #include <glib.h>
> -
> -#ifdef USE_USBREDIR
>  #include <libusb.h>
>  
>  G_BEGIN_DECLS
> @@ -32,5 +30,3 @@ void spice_usb_util_get_device_strings(int bus, int address,
>                                         gchar **manufacturer, gchar **product);
>  
>  G_END_DECLS
> -
> -#endif /* USE_USBREDIR */
> -- 
> 2.21.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190919/50bbf092/attachment.sig>


More information about the Spice-devel mailing list