summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-05-02 18:50:14 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-05-03 15:47:48 +0200
commit8a161d08c92f3fee01e97ede54917abbf7085b24 (patch)
treeef9f516648041e25fb79d3208a0a5f6347fac2f6
parent5e9efe31f1de05c8c65a7383fcbf211ebded6a22 (diff)
downloadfocaccia-qemu-8a161d08c92f3fee01e97ede54917abbf7085b24.tar.gz
focaccia-qemu-8a161d08c92f3fee01e97ede54917abbf7085b24.zip
build: do not build virtio-vga-gl if virgl/opengl not available
If virgl and opengl are not available, the build process creates a useless
libvirtio-vga-gl module that does not have any device in it.  Follow the
example of virtio-vga-rutabaga and do not build the module at all in that
case.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/display/meson.build14
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/display/meson.build b/hw/display/meson.build
index 7893b94c8e..7db05eace9 100644
--- a/hw/display/meson.build
+++ b/hw/display/meson.build
@@ -125,12 +125,14 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA')
                                          if_false: files('acpi-vga-stub.c'))
   hw_display_modules += {'virtio-vga': virtio_vga_ss}
 
-  virtio_vga_gl_ss = ss.source_set()
-  virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl],
-                       if_true: [files('virtio-vga-gl.c'), pixman])
-  virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
-                                            if_false: files('acpi-vga-stub.c'))
-  hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss}
+  if virgl.found() and opengl.found()
+    virtio_vga_gl_ss = ss.source_set()
+    virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl],
+                         if_true: [files('virtio-vga-gl.c'), pixman])
+    virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'),
+                                              if_false: files('acpi-vga-stub.c'))
+    hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss}
+  endif
 
   if rutabaga.found()
     virtio_vga_rutabaga_ss = ss.source_set()