aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-20 17:33:40 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-28 08:51:57 +0200
commit88b6e618fda51cd2cfe7931e480e86ff8005a7d7 (patch)
tree5fac9243b741d73dd3d62967bbcdf6e20b990e2d /meson.build
parent28609749feab39502919475acb72eeab53f99257 (diff)
configure, meson: move OpenGL check to meson
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 11 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index 9beca38ebb..83b7347c5f 100644
--- a/meson.build
+++ b/meson.build
@@ -1000,9 +1000,14 @@ if not get_option('coreaudio').auto() or (targetos == 'darwin' and have_system)
endif
opengl = not_found
-if 'CONFIG_OPENGL' in config_host
- opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
- link_args: config_host['OPENGL_LIBS'].split())
+if not get_option('opengl').auto() or have_system or have_vhost_user_gpu
+ epoxy = dependency('epoxy', method: 'pkg-config',
+ required: get_option('opengl'), kwargs: static_kwargs)
+ if cc.has_header('epoxy/egl.h', dependencies: epoxy)
+ opengl = epoxy
+ elif get_option('opengl').enabled()
+ error('epoxy/egl.h not found')
+ endif
endif
gbm = not_found
if (have_system or have_tools) and (virgl.found() or opengl.found())
@@ -1546,6 +1551,7 @@ config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
config_host_data.set('CONFIG_NUMA', numa.found())
+config_host_data.set('CONFIG_OPENGL', opengl.found())
config_host_data.set('CONFIG_PROFILER', get_option('profiler'))
config_host_data.set('CONFIG_RBD', rbd.found())
config_host_data.set('CONFIG_SDL', sdl.found())
@@ -2093,7 +2099,7 @@ host_kconfig = \
(have_tpm ? ['CONFIG_TPM=y'] : []) + \
(spice.found() ? ['CONFIG_SPICE=y'] : []) + \
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
- ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \
+ (opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
(x11.found() ? ['CONFIG_X11=y'] : []) + \
('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \
('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=y'] : []) + \
@@ -3708,7 +3714,7 @@ summary_info += {'smartcard support': cacard}
summary_info += {'U2F support': u2f}
summary_info += {'libusb': libusb}
summary_info += {'usb net redir': usbredir}
-summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
+summary_info += {'OpenGL support (epoxy)': opengl}
summary_info += {'GBM': gbm}
summary_info += {'libiscsi support': libiscsi}
summary_info += {'libnfs support': libnfs}