meson: Fix opengl dependency

This commit is contained in:
Matt Borgerson 2025-01-06 16:27:04 -07:00
parent 675599dd56
commit 1b13d92075
1 changed files with 12 additions and 6 deletions

View File

@ -1748,13 +1748,19 @@ endif
opengl = not_found
if not get_option('opengl').auto() or have_system or have_vhost_user_gpu
epoxy = dependency('epoxy', method: 'pkg-config',
required: get_option('opengl'))
if cc.has_header('epoxy/egl.h', dependencies: epoxy)
opengl = epoxy
elif get_option('opengl').enabled()
error('epoxy/egl.h not found')
# FIXME: Use meson's 'gl' dep
if host_os == 'darwin'
opengl_libs=['-framework', 'OpenGL']
elif host_os == 'windows'
opengl_libs=['-lopengl32', '-lgdi32']
elif host_os == 'linux'
opengl_libs=['-lGL']
else
error('Unknown GL platform')
endif
opengl = declare_dependency(compile_args: config_host['EPOXY_CFLAGS'].split(),
link_args: config_host['EPOXY_LIBS'].split() + opengl_libs)
endif
gbm = not_found