Meson: Override wayland-scanner if it can be run
authorXavier Claessens <xavier.claessens@collabora.com>
Mon, 4 Apr 2022 13:34:33 +0000 (09:34 -0400)
committerPekka Paalanen <pq@iki.fi>
Tue, 24 May 2022 14:09:33 +0000 (14:09 +0000)
This allows projects to use Wayland as a Meson subproject and get the
wayland-scanner executable when doing find_program('wayland-scanner').

Signed-off-by: Xavier Claessens <xavier.claessens@collabora.com>
src/meson.build

index a601724..a8a1d2b 100644 (file)
@@ -71,6 +71,10 @@ if get_option('scanner')
                ],
                filebase: 'wayland-scanner'
        )
+
+       if meson.can_run_host_binaries()
+               meson.override_find_program('wayland-scanner', wayland_scanner)
+       endif
 endif
 
 if meson.is_cross_build() or not get_option('scanner')