meson.build: build introspection according to option only

The way the check is written, if the build is native, then the
introspection option has no effect.

Particularly yocto project does want to disable introspection in
native builds and enable it in cross builds (both via the option),
and without this patch the former is not possible.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
This commit is contained in:
Alexander Kanavin 2023-01-02 15:00:02 +01:00
parent 8b469a2727
commit ae71d338d7

View File

@ -730,7 +730,7 @@ endif
# 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').enabled())
build_gir = gir.found() and get_option('introspection').enabled()
project_build_root = meson.current_build_dir()