From 16487ebc0639103221f875b226210e7561641fd0 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 31 Dec 2018 13:13:53 +0200 Subject: [PATCH] meson: better errors for x11-backend deps Helps people avoid X11 related dependencies if they don't want them. Signed-off-by: Pekka Paalanen --- libweston/meson.build | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/libweston/meson.build b/libweston/meson.build index d7dfa3fb..e51480ed 100644 --- a/libweston/meson.build +++ b/libweston/meson.build @@ -334,15 +334,25 @@ if get_option('backend-x11') presentation_time_server_protocol_h, ] + dep_x11_xcb = dependency('xcb', version: '>= 1.8', required: false) + if not dep_x11_xcb.found() + error('x11-backend requires xcb >= 1.8 which was not found. Or, you can use \'-Dbackend-x11=false\'.') + endif + deps_x11 = [ - dependency('xcb', version: '>= 1.8'), - dependency('xcb-shm'), - dependency('x11'), - dependency('x11-xcb'), + dep_x11_xcb, dep_lib_cairo_shared, dep_pixman, ] + foreach name : [ 'xcb-shm', 'x11', 'x11-xcb' ] + d = dependency(name, required: false) + if not d.found() + error('x11-backend requires @0@ which was not found. Or, you can use \'-Dbackend-x11=false\'.'.format(name)) + endif + deps_x11 += d + endforeach + dep_xcb_xkb = dependency('xcb-xkb', version: '>= 1.9', required: false) if dep_xcb_xkb.found() deps_x11 += dep_xcb_xkb