[Spice-devel] [PATCH spice-gtk v5 10/18] build: Do not build usbredir dependent file is usbredir disabled

Frediano Ziglio fziglio at redhat.com
Wed Aug 28 14:14:13 UTC 2019


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>
---
 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 00eb2778..0461dea6 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 36a73a89..857ffdf7 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>
@@ -1513,5 +1511,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 5052ef36..aebed350 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 6c570d94..2f683fa8 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.20.1



More information about the Spice-devel mailing list