From 8e6e41bab6aafde79f13aebd9e964493ca433a70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?=
 <vjaquez@igalia.com>
Date: Mon, 28 Jan 2019 12:30:01 +0100
Subject: [PATCH] build: meson: compile without wayland support

This patch replaces the PR

https://github.com/intel/intel-vaapi-driver/pull/441
---
 meson.build | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 51bb1d09f..fa0b2f2ed 100644
--- a/meson.build
+++ b/meson.build
@@ -81,17 +81,22 @@ if get_option('with_wayland') != 'no'
 
   if wayland_client_dep.found()
     prefix = wayland_client_dep.get_pkgconfig_variable('prefix')
-    wl_scanner = find_program(
-      'wayland-scanner',
-      join_paths(prefix, '/bin/wayland-scanner'))
+    wayland_scanner = join_paths(prefix, 'bin', 'wayland-scanner')
+  else
+    wayland_scanner = ''
   endif
 
+  wl_scanner = find_program('wayland-scanner', wayland_scanner,
+			    required : get_option('with_wayland') == 'yes')
+
   libva_wayland_dep = dependency(
     'libva-wayland',
     version : libva_version,
     required : get_option('with_wayland') == 'yes')
 
-  WITH_WAYLAND = wl_scanner.found() and libva_wayland_dep.found()
+  WITH_WAYLAND = (wayland_client_dep.found()
+		  and wl_scanner.found()
+		  and libva_wayland_dep.found())
 endif
 
 subdir('src')