configure, meson: Migrate gl check to meson

This commit is contained in:
Matt Borgerson 2023-01-23 00:30:40 -07:00
parent ec7d5ce8db
commit 25ced4f4c1
2 changed files with 12 additions and 20 deletions

14
configure vendored
View File

@ -1548,20 +1548,6 @@ esac
##########################################
# XBOX
if test "$opengl" != "no" ; then
if test "$darwin" = "yes" ; then
opengl_libs="$opengl_libs -framework OpenGL"
elif test "$mingw32" = "yes" ; then
opengl_libs="$opengl_libs -lopengl32 -lgdi32"
elif test "$linux" = "yes" ; then
opengl_libs="$opengl_libs -lGLU -lGL"
fi
opengl_libs="$opengl_libs $($pkg_config --libs epoxy)"
opengl_cflags="$opengl_cflags $($pkg_config --cflags epoxy)"
QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags"
fi # test "$opengl" != "no"
# check and set a backend for coroutine
# We prefer ucontext, but it's not always possible. The fallback

View File

@ -1158,14 +1158,20 @@ endif
opengl = not_found
if not get_option('opengl').auto() or have_system or have_vhost_user_gpu
# FIXME: Use meson's 'gl' dep
if targetos == 'darwin'
opengl_libs=['-framework OpenGL']
elif targetos == 'windows'
opengl_libs=['-lopengl32', '-lgdi32']
elif targetos == 'linux'
opengl_libs=['-lGLU', '-lGL']
endif
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
required: true, kwargs: static_kwargs)
opengl = declare_dependency(link_args: opengl_libs,
dependencies: epoxy)
endif
gbm = not_found
if (have_system or have_tools) and (virgl.found() or opengl.found())
gbm = dependency('gbm', method: 'pkg-config', required: false,