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