if with_gallium_vc4
subdir('broadcom')
endif
-subdir('intel')
+if with_dri_i965 or with_intel_vk
+ subdir('intel')
+endif
subdir('mesa')
subdir('loader')
subdir('glx')
-if with_platform_wayland
- subdir('egl/wayland/wayland-egl')
-endif
if with_gbm
subdir('gbm')
endif
subdir('egl')
endif
subdir('gallium')
+
+# This must be after at least mesa, glx, and gallium, since libgl will be
+# defined in one of those subdirs depending on the glx provider.
+if with_glx != 'disabled'
+ pkg.generate(
+ name : 'gl',
+ description : 'Mesa OpenGL Library',
+ version : meson.project_version(),
+ libraries : libgl,
+ libraries_private : gl_priv_libs,
+ requires_private : gl_priv_reqs,
+ variables : ['glx_tls=yes'],
+ )
+endif