build: fix gi-docgen detection in cross builds
authorMichal Vasilek <michal@vasilek.cz>
Sun, 18 Sep 2022 18:48:21 +0000 (20:48 +0200)
committerMichal Vasilek <michal@vasilek.cz>
Mon, 19 Sep 2022 23:27:26 +0000 (01:27 +0200)
gi-docgen is supposed to be ran natively on the build machine, without
native: true dependency() searches for gi-docgen on the host system.
When it doesn't find it, it falls back to a subproject even if gi-docgen
is available on the build machine.

also make gtk_doc require introspection

meson.build

index f45da9dce3d1633ba52c817c22698d66ef3b838f..a4e69be6d1cd2dc87ac9d4d107002703a67c3550 100644 (file)
@@ -443,7 +443,8 @@ iso_codes_dep  = dependency('iso-codes', required: false)
 
 gidocgen_dep    = dependency('gi-docgen', version: '>= 2021.1',
                              fallback: ['gi-docgen', 'dummy_dep'],
-                             required: get_option('gtk_doc'))
+                             required: get_option('gtk_doc') and get_option('introspection').enabled(),
+                             native: true)
 gi_dep         = dependency('gobject-introspection-1.0', version: introspection_req,
                             required: get_option('introspection').enabled() and
                                       get_option('build-tests'))