build: Handle introspection a bit better
authorMatthias Clasen <mclasen@redhat.com>
Wed, 8 Mar 2023 02:20:43 +0000 (21:20 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 8 Mar 2023 02:49:24 +0000 (21:49 -0500)
Error out if introspection is requested,
but g-ir-scanner isn't found.

And if introspection isn't explicitly disabled
but is required for building the docs, build it.

meson.build

index 07912b124ef81d84bdf87a6de7b8c8e409617e66..e89ce6872af871691d551af603ac97c6e85b36a9 100644 (file)
@@ -728,8 +728,13 @@ endif
 
 # Introspection
 gir = find_program('g-ir-scanner', required : get_option('introspection'))
-build_gir = gir.found() and get_option('introspection').enabled()
 
+if not gir.found() and get_option('introspection').enabled()
+  error('Introspection enabled, but g-ir-scanner not found.')
+endif
+
+build_gir = gir.found() and (get_option('introspection').enabled() or
+                             (get_option('introspection').allowed() and get_option('gtk_doc')))
 
 project_build_root = meson.current_build_dir()