meson: refine check for whether to look for virglrenderer
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 17 Dec 2021 11:36:26 +0000 (12:36 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 21 Feb 2022 09:35:53 +0000 (10:35 +0100)
The check should be performed even if !have_system, as long as there is some hope that
vhost-user-gpu will be built.  Store into have_vhost_user_gpu whether vhost-user-gpu
will be built; we will also use the variable to decide whether to look for libepoxy.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
contrib/vhost-user-gpu/meson.build
meson.build

index b4e26045da45fb424f1012eac008438fb0a8e908..c8883c2d8e528043f7cb3a1f8244290a7e52a6b9 100644 (file)
@@ -1,5 +1,4 @@
-if have_tools and virgl.found() and gbm.found() \
-    and 'CONFIG_LINUX' in config_host and pixman.found()
+if have_vhost_user_gpu
   executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
              dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, opengl],
              install: true,
index b9bedf928af1767a7e38b41b75e48d2e2e869e68..5ad346816ef24e6980abcd857702f674a685c06d 100644 (file)
@@ -621,7 +621,9 @@ if not get_option('zstd').auto() or have_block
                     method: 'pkg-config', kwargs: static_kwargs)
 endif
 virgl = not_found
-if not get_option('virglrenderer').auto() or have_system
+
+have_vhost_user_gpu = have_tools and targetos == 'linux' and pixman.found()
+if not get_option('virglrenderer').auto() or have_system or have_vhost_user_gpu
   virgl = dependency('virglrenderer',
                      method: 'pkg-config',
                      required: get_option('virglrenderer'),
@@ -1000,6 +1002,7 @@ if (have_system or have_tools) and (virgl.found() or opengl.found())
   gbm = dependency('gbm', method: 'pkg-config', required: false,
                    kwargs: static_kwargs)
 endif
+have_vhost_user_gpu = have_vhost_user_gpu and virgl.found() and gbm.found()
 
 gnutls = not_found
 gnutls_crypto = not_found