meson: add missing libweston EGL dependency if renderer-gl is enabled

If the 'renderer-gl' option is enabled, ENABLE_EGL is defined, and
libweston/pixel-formats.c includes EGL/egl.h. This requires an egl
dependency, as X11-less platforms need the MESA_EGL_NO_X11_HEADERS
define from egl.pc cflags:

  In file included from /usr/include/EGL/egl.h:39:0,
                   from ../libweston/pixel-formats.c:42:
  /usr/include/EGL/eglplatform.h:124:10: fatal error: X11/Xlib.h: No such file or directory
  compilation terminated.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2019-02-13 15:10:35 +01:00 committed by Philipp Zabel
parent c58648b0df
commit cca7346557

View File

@ -67,6 +67,14 @@ install_headers(
subdir: dir_include_libweston
)
if get_option('renderer-gl')
dep_egl = dependency('egl', required: false)
if not dep_egl.found()
error('libweston + gl-renderer requires egl which was not found. Or, you can use \'-Drenderer-gl=false\'.')
endif
deps_libweston += dep_egl
endif
lib_weston = shared_library(
'weston-@0@'.format(libweston_major),
srcs_libweston,
@ -375,11 +383,10 @@ if get_option('backend-x11')
endif
if get_option('renderer-gl')
d = dependency('egl', required: false)
if not d.found()
if not dep_egl.found()
error('x11-backend + gl-renderer requires egl which was not found. Or, you can use \'-Dbackend-x11=false\' or \'-Drenderer-gl=false\'.')
endif
deps_x11 += d
deps_x11 += dep_egl
endif
plugin_x11 = shared_library(