+else
+ inc_gbm = []
+endif
+if with_egl
+ subdir('egl')
+endif
+if with_gallium
+ subdir('gallium')
+ # This has to be here since it requires libgallium, and subdir cannot
+ # contain ..
+ if with_tests and with_shared_glapi
+ subdir('mesa/state_tracker/tests')
+ endif
+endif
+
+# 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' and not with_glvnd
+ 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=@0@'.format(use_elf_tls ? 'yes' : 'no')],
+ )