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"
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>
coref = []
iokit = []
emulator_link_args = []
-cocoa = not_found
hvf = not_found
if targetos == 'windows'
socket = cc.find_library('ws2_32')
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'),
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 #
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',
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
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'),