diff --git a/gtk/meson.build b/gtk/meson.build index 61185696dd..7ac245419a 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -1180,9 +1180,6 @@ libgtk = shared_library('gtk-4', gtk_dep_sources = [gtkversion, gtktypebuiltins_h] # 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()) - if build_gir gir_args = [ '-DGTK_COMPILATION', diff --git a/meson.build b/meson.build index d0d3b432c5..80304b0edd 100644 --- a/meson.build +++ b/meson.build @@ -728,6 +728,11 @@ int main () { endif 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()) + + project_build_root = meson.current_build_dir() subdir('gtk/css') diff --git a/testsuite/introspection/api.py b/testsuite/introspection/api.py index a2feac37ea..9bbbedfe13 100755 --- a/testsuite/introspection/api.py +++ b/testsuite/introspection/api.py @@ -14,7 +14,10 @@ if hasattr(os, 'add_dll_directory'): if path != '' and os.path.isdir(path): os.add_dll_directory(path) -import gi +try: + import gi +except ImportError: + sys.exit(77) # skip this test, gi module is not available gi.require_version('Gtk', '4.0') diff --git a/testsuite/introspection/meson.build b/testsuite/introspection/meson.build index c64a0f54d3..a30c687353 100644 --- a/testsuite/introspection/meson.build +++ b/testsuite/introspection/meson.build @@ -1,5 +1,3 @@ -py = import('python').find_installation('python3', modules: ['gi']) - env = environment() env.prepend('GI_TYPELIB_PATH', project_build_root / 'gtk',