[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/20] configure: move Cocoa incompatibility checks to Meson
From: |
Paolo Bonzini |
Subject: |
[PULL 18/20] configure: move Cocoa incompatibility checks to Meson |
Date: |
Tue, 12 Jan 2021 18:14:48 +0100 |
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 d70448f495..17aa595343 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 73d3cc5385..1f12c43765 100644
--- a/meson.build
+++ b/meson.build
@@ -169,7 +169,6 @@ version_res = []
coref = []
iokit = []
emulator_link_args = []
-cocoa = not_found
hvf = not_found
if targetos == 'windows'
socket = cc.find_library('ws2_32')
@@ -182,7 +181,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'),
@@ -256,9 +254,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 #
@@ -362,6 +357,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',
@@ -647,7 +650,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
@@ -779,7 +782,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
- [PULL 00/20] Misc patches for 2021-01-12, Paolo Bonzini, 2021/01/12
- [PULL 01/20] meson: do not use CONFIG_VIRTFS, Paolo Bonzini, 2021/01/12
- [PULL 07/20] whpx: move whpx_lapic_state from header to c file, Paolo Bonzini, 2021/01/12
- [PULL 02/20] whpx: rename whp-dispatch to whpx-internal.h, Paolo Bonzini, 2021/01/12
- [PULL 06/20] maintainers: Add me as Windows Hosted Continuous Integration maintainer, Paolo Bonzini, 2021/01/12
- [PULL 04/20] cirrus/msys2: Exit powershell with $LastExitCode, Paolo Bonzini, 2021/01/12
- [PULL 03/20] whpx: move internal definitions to whpx-internal.h, Paolo Bonzini, 2021/01/12
- [PULL 18/20] configure: move Cocoa incompatibility checks to Meson,
Paolo Bonzini <=
- [PULL 20/20] target/i386: Use X86Seg enum for segment registers, Paolo Bonzini, 2021/01/12
- [PULL 05/20] cirrus/msys2: Cache msys2 mingw in a better way., Paolo Bonzini, 2021/01/12
- [PULL 09/20] scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame, Paolo Bonzini, 2021/01/12
- [PULL 08/20] meson: fix Cocoa option in summary, Paolo Bonzini, 2021/01/12
- [PULL 10/20] scripts/gdb: implement 'qemu bt', Paolo Bonzini, 2021/01/12
- [PULL 11/20] Docs/RCU: Correct sample code of qatomic_rcu_set, Paolo Bonzini, 2021/01/12
- [PULL 14/20] cocoa: do not enable coreaudio automatically, Paolo Bonzini, 2021/01/12
- [PULL 12/20] meson: Propagate gnutls dependency, Paolo Bonzini, 2021/01/12
- [PULL 13/20] virtio-scsi: trace events, Paolo Bonzini, 2021/01/12
- [PULL 15/20] gtk: remove CONFIG_GTK_GL, Paolo Bonzini, 2021/01/12