All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, marcandre.lureau@redhat.com,
	berrange@redhat.com, stefanha@redhat.com
Subject: [PATCH 6/8] configure: move Cocoa incompatibility checks to Meson
Date: Thu,  7 Jan 2021 15:00:37 +0100	[thread overview]
Message-ID: <20210107140039.467969-7-pbonzini@redhat.com> (raw)
In-Reply-To: <20210107140039.467969-1-pbonzini@redhat.com>

The cocoa UI code currently assumes it is always the active UI
and does not interact well with other UI frontend code.  Move
the relevant checks to Meson now that all other frontends
have become Meson options.  This way, SDL/GTK+/Cocoa can be
parsed entirely by scripts/configure-parse-buildoptions.pl.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure   | 15 ---------------
 meson.build | 17 ++++++++++-------
 2 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/configure b/configure
index 652cff7ba6..d573058b16 100755
--- a/configure
+++ b/configure
@@ -772,7 +772,6 @@ Darwin)
     QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
     QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
   fi
-  cocoa="enabled"
   audio_drv_list="coreaudio try-sdl"
   audio_possible_drivers="coreaudio sdl"
   QEMU_LDFLAGS="-framework CoreFoundation -framework IOKit $QEMU_LDFLAGS"
@@ -2322,20 +2321,6 @@ if test -z "$want_tools"; then
 fi
 
 ##########################################
-# cocoa implies not SDL or GTK
-# (the cocoa UI code currently assumes it is always the active UI
-# and doesn't interact well with other UI frontend code)
-if test "$cocoa" = "enabled"; then
-    if test "$sdl" = "enabled"; then
-        error_exit "Cocoa and SDL UIs cannot both be enabled at once"
-    fi
-    if test "$gtk" = "enabled"; then
-        error_exit "Cocoa and GTK UIs cannot both be enabled at once"
-    fi
-    gtk=disabled
-    sdl=disabled
-fi
-
 # Some versions of Mac OS X incorrectly define SIZE_MAX
 cat > $TMPC << EOF
 #include <stdint.h>
diff --git a/meson.build b/meson.build
index a3a0958b4d..5a8efd2316 100644
--- a/meson.build
+++ b/meson.build
@@ -148,7 +148,6 @@ version_res = []
 coref = []
 iokit = []
 emulator_link_args = []
-cocoa = not_found
 hvf = not_found
 if targetos == 'windows'
   socket = cc.find_library('ws2_32')
@@ -161,7 +160,6 @@ if targetos == 'windows'
 elif targetos == 'darwin'
   coref = dependency('appleframeworks', modules: 'CoreFoundation')
   iokit = dependency('appleframeworks', modules: 'IOKit')
-  cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
 elif targetos == 'sunos'
   socket = [cc.find_library('socket'),
             cc.find_library('nsl'),
@@ -252,9 +250,6 @@ if not have_xen_pci_passthrough and get_option('xen_pci_passthrough').enabled()
     error('Xen PCI passthrough requested but Xen not enabled')
   endif
 endif
-if not cocoa.found() and get_option('cocoa').enabled()
-  error('Cocoa not available on this platform')
-endif
 
 ################
 # Dependencies #
@@ -358,6 +353,14 @@ if not get_option('attr').disabled()
   endif
 endif
 
+cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
+if cocoa.found() and get_option('sdl').enabled()
+  error('Cocoa and SDL cannot be enabled at the same time')
+endif
+if cocoa.found() and get_option('gtk').enabled()
+  error('Cocoa and GTK+ cannot be enabled at the same time')
+endif
+
 seccomp = not_found
 if not get_option('seccomp').auto() or have_system or have_tools
   seccomp = dependency('libseccomp', version: '>=2.3.0',
@@ -643,7 +646,7 @@ if not get_option('brlapi').auto() or have_system
 endif
 
 sdl = not_found
-if have_system
+if not get_option('sdl').auto() or (have_system and not cocoa.found())
   sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static)
   sdl_image = not_found
 endif
@@ -775,7 +778,7 @@ endif
 
 gtk = not_found
 gtkx11 = not_found
-if not get_option('gtk').auto() or have_system
+if not get_option('gtk').auto() or (have_system and not cocoa.found())
   gtk = dependency('gtk+-3.0', version: '>=3.22.0',
                    method: 'pkg-config',
                    required: get_option('gtk'),
-- 
2.29.2




  parent reply	other threads:[~2021-01-07 14:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 14:00 [RFC PATCH v2 0/8] Automatically convert configure options to meson build options Paolo Bonzini
2021-01-07 14:00 ` [PATCH 1/8] build-system: clean up TCG/TCI configury Paolo Bonzini
2021-01-07 15:01   ` Peter Maydell
2021-01-07 15:50     ` Paolo Bonzini
2021-01-07 16:06       ` Daniel P. Berrangé
2021-01-13 13:09         ` Philippe Mathieu-Daudé
2021-01-13 13:42           ` Helge Deller
2021-01-13 13:57             ` Daniel P. Berrangé
2021-01-13 14:23               ` Peter Maydell
2021-01-13 20:39                 ` Helge Deller
2021-01-13 14:23               ` Helge Deller
2021-01-13 14:34                 ` Paolo Bonzini
2021-01-13 15:37                   ` Helge Deller
2021-01-14  9:51                 ` John Paul Adrian Glaubitz
2021-01-13 14:02             ` John David Anglin
2021-01-13 15:00           ` John Paul Adrian Glaubitz
2021-01-07 14:00 ` [PATCH 2/8] cocoa: do not enable coreaudio automatically Paolo Bonzini
2021-01-07 14:00 ` [PATCH 3/8] gtk: remove CONFIG_GTK_GL Paolo Bonzini
2021-01-07 16:05   ` Gerd Hoffmann
2021-01-07 14:00 ` [PATCH 4/8] configure: move X11 detection to Meson Paolo Bonzini
2021-01-07 14:00 ` [PATCH 5/8] configure: move GTK+ " Paolo Bonzini
2021-01-07 14:00 ` Paolo Bonzini [this message]
2021-01-07 14:00 ` [PATCH 7/8] configure: quote command line arguments in config.status Paolo Bonzini
2021-01-13 15:44   ` Eric Blake
2021-01-07 14:00 ` [PATCH 8/8] configure: automatically parse command line for meson -D options Paolo Bonzini
2021-01-13 10:31   ` Daniel P. Berrangé
2021-01-13 12:26     ` Paolo Bonzini
2021-01-13 14:04     ` Paolo Bonzini
2021-01-22  8:00       ` 罗勇刚(Yonggang Luo)
2021-01-22 20:43         ` Paolo Bonzini
2021-01-23  3:30           ` 罗勇刚(Yonggang Luo)
2021-01-23 18:00             ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210107140039.467969-7-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.