From cca734655764d0d05543653aa37d288e64ba3304 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Wed, 13 Feb 2019 15:10:35 +0100 Subject: [PATCH] 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 --- libweston/meson.build | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libweston/meson.build b/libweston/meson.build index 6aaa4106..d506cddd 100644 --- a/libweston/meson.build +++ b/libweston/meson.build @@ -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(