[PATCH 60/67] ui/vnc: VNC requires PIXMAN

marcandre.lureau@redhat.com posted 67 patches 2 years, 5 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, Peter Maydell <peter.maydell@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Akihiko Odaki <akihiko.odaki@daynix.com>
[PATCH 60/67] ui/vnc: VNC requires PIXMAN
Posted by marcandre.lureau@redhat.com 2 years, 5 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 meson.build    | 5 ++++-
 ui/meson.build | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index 3bd7046099..ceafbc5b73 100644
--- a/meson.build
+++ b/meson.build
@@ -1549,7 +1549,10 @@ endif
 vnc = not_found
 jpeg = not_found
 sasl = not_found
-if get_option('vnc').allowed() and have_system
+if get_option('vnc') \
+  .disable_auto_if(not pixman.found()) \
+  .require(pixman.found()) \
+  .allowed() and have_system
   vnc = declare_dependency() # dummy dependency
   jpeg = dependency('libjpeg', required: get_option('vnc_jpeg'),
                     method: 'pkg-config')
diff --git a/ui/meson.build b/ui/meson.build
index 7c99613950..b3525ef064 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -46,8 +46,8 @@ vnc_ss.add(files(
 ))
 vnc_ss.add(zlib, jpeg, gnutls)
 vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c'))
-system_ss.add_all(when: vnc, if_true: vnc_ss)
-system_ss.add(when: vnc, if_false: files('vnc-stubs.c'))
+system_ss.add_all(when: [vnc, pixman], if_true: vnc_ss)
+system_ss.add(when: [vnc, pixman], if_false: files('vnc-stubs.c'))
 
 ui_modules = {}
 
-- 
2.41.0


Re: [PATCH 60/67] ui/vnc: VNC requires PIXMAN
Posted by Paolo Bonzini 2 years, 5 months ago
On 8/30/23 11:38, marcandre.lureau@redhat.com wrote:
> -if get_option('vnc').allowed() and have_system
> +if get_option('vnc') \
> +  .disable_auto_if(not pixman.found()) \
> +  .require(pixman.found()) \
> +  .allowed() and have_system

".disable_auto_if()" is not needed, because ".require()" handles it.

However, please add an error message for ".require()" and make it a seprate variable:

have_vnc = get_option('vnc') \
   .disable_auto_if(not have_system) \
   .require(pixman.found(),
            error_message: 'cannot enable VNC if pixman is not available') \
   .allowed()

Thanks,

Paolo