src/meson.build: allow introspection when cross-compiling

introspection can be enabled when cross-compiling on certains conditions
(for example it is supported by buildroot) so, as suggested by
Tim-Philipp Müller, disable it by default for cross builds unless the
option was explicitly enabled by the user

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
Fabrice Fontaine 2020-09-24 21:00:34 +02:00
parent 8c5d1332f1
commit 2604201ae0
1 changed files with 1 additions and 6 deletions

View File

@ -635,12 +635,7 @@ if have_gobject
)
gir = find_program('g-ir-scanner', required: get_option('introspection'))
build_gir = gir.found()
build_gir = build_gir and not meson.is_cross_build()
if not build_gir and get_option('introspection').enabled()
error('Introspection support is requested but it isn\'t available in cross builds')
endif
build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
build_gir = build_gir and get_option('default_library') != 'static'
if not build_gir and get_option('introspection').enabled()