@@ -186,7 +186,6 @@ HELPERS-y =
HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy)
-HELPERS-y += vhost-user-gpu$(EXESUF)
vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
endif
@@ -289,7 +288,6 @@ dummy := $(call unnest-vars,, \
elf2dmp-obj-y \
ivshmem-client-obj-y \
ivshmem-server-obj-y \
- vhost-user-gpu-obj-y \
qga-vss-dll-obj-y \
block-obj-y \
block-obj-m \
@@ -497,9 +495,6 @@ ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COMMON_LDADDS)
$(call LINK, $^)
endif
-vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) contrib/libvhost-user/libvhost-user.a $(COMMON_LDADDS)
- $(call LINK, $^)
-
module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak
$(call quiet-command,$(PYTHON) $< $@ \
$(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \
@@ -108,6 +108,5 @@ qga-vss-dll-obj-y = qga/
elf2dmp-obj-y = contrib/elf2dmp/
ivshmem-client-obj-$(CONFIG_IVSHMEM) = contrib/ivshmem-client/
ivshmem-server-obj-$(CONFIG_IVSHMEM) = contrib/ivshmem-server/
-vhost-user-gpu-obj-y = contrib/vhost-user-gpu/
######################################################################
deleted file mode 100644
@@ -1,10 +0,0 @@
-vhost-user-gpu-obj-y = main.o virgl.o vugbm.o
-
-main.o-cflags := $(PIXMAN_CFLAGS) $(GBM_CFLAGS)
-main.o-libs := $(PIXMAN_LIBS)
-
-virgl.o-cflags := $(VIRGL_CFLAGS) $(GBM_CFLAGS)
-virgl.o-libs := $(VIRGL_LIBS)
-
-vugbm.o-cflags := $(GBM_CFLAGS)
-vugbm.o-libs := $(GBM_LIBS)
new file mode 100644
@@ -0,0 +1,5 @@
+if 'CONFIG_VIRGL' in config_host and 'CONFIG_GBM' in config_host
+ executable('vhost-user-gpu', files('main.c', 'virgl.c', 'vugbm.c'),
+ link_with: libvhost_user,
+ dependencies: [qemuutil, pixman, gbm, virgl])
+endif
@@ -52,11 +52,23 @@ if 'CONFIG_GNUTLS' in config_host
gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
link_args: config_host['GNUTLS_LIBS'].split())
endif
+pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(),
+ link_args: config_host['PIXMAN_LIBS'].split())
libiscsi = declare_dependency()
if 'CONFIG_LIBISCSI' in config_host
libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(),
link_args: config_host['LIBISCSI_LIBS'].split())
endif
+gbm = declare_dependency()
+if 'CONFIG_GBM' in config_host
+ gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
+ link_args: config_host['GBM_LIBS'].split())
+endif
+virgl = declare_dependency()
+if 'CONFIG_VIRGL' in config_host
+ virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(),
+ link_args: config_host['VIRGL_LIBS'].split())
+endif
target_dirs = config_host['TARGET_DIRS'].split()
have_user = false
@@ -201,6 +213,9 @@ if have_tools
if 'CONFIG_VHOST_USER' in config_host
subdir('contrib/libvhost-user')
subdir('contrib/vhost-user-blk')
+ if 'CONFIG_LINUX' in config_host
+ subdir('contrib/vhost-user-gpu')
+ endif
subdir('contrib/vhost-user-input')
subdir('contrib/vhost-user-scsi')
endif