aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-09-01 11:28:59 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-30 19:11:36 +0200
commitb4e312e953b71c8dbb9ff4ee195b6189a0bf628b (patch)
tree745383f00c207ae418def17ec36f79dbfd29bbcd /meson.build
parent84ec0c24357250b53fd6034f0dfe5254f0e4458b (diff)
configure: move cocoa option to Meson
While detection of the framework was already there, moving the option allows for better error reporting. Reported-by: Christophe de Dinechin <dinechin@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build9
1 files changed, 7 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index afe53d8f0c..34d4ff96aa 100644
--- a/meson.build
+++ b/meson.build
@@ -101,7 +101,7 @@ socket = []
version_res = []
coref = []
iokit = []
-cocoa = []
+cocoa = not_found
hvf = []
if targetos == 'windows'
socket = cc.find_library('ws2_32')
@@ -114,7 +114,7 @@ if targetos == 'windows'
elif targetos == 'darwin'
coref = dependency('appleframeworks', modules: 'CoreFoundation')
iokit = dependency('appleframeworks', modules: 'IOKit')
- cocoa = dependency('appleframeworks', modules: 'Cocoa')
+ cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
hvf = dependency('appleframeworks', modules: 'Hypervisor')
elif targetos == 'sunos'
socket = [cc.find_library('socket'),
@@ -126,6 +126,10 @@ elif targetos == 'haiku'
cc.find_library('bsd')]
endif
+if not cocoa.found() and get_option('cocoa').enabled()
+ error('Cocoa not available on this platform')
+endif
+
################
# Dependencies #
################
@@ -536,6 +540,7 @@ endif
# Create config-host.h
+config_host_data.set('CONFIG_COCOA', cocoa.found())
config_host_data.set('CONFIG_LIBUDEV', libudev.found())
config_host_data.set('CONFIG_MPATH', mpathpersist.found())
config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)