From 4b8cdeec09290b5adb217d7f6dbfa5a00822c6a4 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 8 Dec 2022 11:35:50 +0000 Subject: [PATCH] build: Conditionally generate introspection We not only want to use the "introspection" option: we also want to avoid building when cross-compiling, and if the introspection tools are not available. GTK's main development branch already has a fairly well tested check, so let's backport it. --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a997efae53..63eb7f807d 100644 --- a/meson.build +++ b/meson.build @@ -866,7 +866,10 @@ if os_darwin module_suffix = 'so' endif -build_gir = get_option('introspection') +# Introspection +gir = find_program('g-ir-scanner', required : get_option('introspection')) +build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection')) + subdir('gdk') subdir('gtk') subdir('modules')