192b42cb3SPatrick Williams# 292b42cb3SPatrick Williams# Copyright OpenEmbedded Contributors 392b42cb3SPatrick Williams# 492b42cb3SPatrick Williams# SPDX-License-Identifier: MIT 592b42cb3SPatrick Williams# 692b42cb3SPatrick Williams 792b42cb3SPatrick Williams# gi-docgen is a new gnome documentation generator, which 892b42cb3SPatrick Williams# seems to be a successor to gtk-doc: 992b42cb3SPatrick Williams# https://gitlab.gnome.org/GNOME/gi-docgen 1092b42cb3SPatrick Williams 11*5082cc7fSAndrew Geissler# True if api-documentation and gobject-introspection-data are in DISTRO_FEATURES, 12*5082cc7fSAndrew Geissler# and qemu-user is in MACHINE_FEATURES, False otherwise. 13*5082cc7fSAndrew GeisslerGIDOCGEN_ENABLED ?= "${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation gobject-introspection-data', \ 14*5082cc7fSAndrew Geissler bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d), 'False', d)}" 15e760df85SPatrick Williams 1692b42cb3SPatrick Williams# When building native recipes, disable gi-docgen, as it is not necessary, 1792b42cb3SPatrick Williams# pulls in additional dependencies, and makes build times longer 1892b42cb3SPatrick WilliamsGIDOCGEN_ENABLED:class-native = "False" 1992b42cb3SPatrick WilliamsGIDOCGEN_ENABLED:class-nativesdk = "False" 2092b42cb3SPatrick Williams 2192b42cb3SPatrick Williams# meson: default option name to enable/disable gi-docgen. This matches most 2292b42cb3SPatrick Williams# projects' configuration. In doubts - check meson_options.txt in project's 2392b42cb3SPatrick Williams# source path. 2492b42cb3SPatrick WilliamsGIDOCGEN_MESON_OPTION ?= 'gtk_doc' 2592b42cb3SPatrick WilliamsGIDOCGEN_MESON_ENABLE_FLAG ?= 'true' 2692b42cb3SPatrick WilliamsGIDOCGEN_MESON_DISABLE_FLAG ?= 'false' 2792b42cb3SPatrick Williams 2892b42cb3SPatrick Williams# Auto enable/disable based on GIDOCGEN_ENABLED 2992b42cb3SPatrick WilliamsEXTRA_OEMESON:prepend = "-D${GIDOCGEN_MESON_OPTION}=${@bb.utils.contains('GIDOCGEN_ENABLED', 'True', '${GIDOCGEN_MESON_ENABLE_FLAG}', '${GIDOCGEN_MESON_DISABLE_FLAG}', d)} " 3092b42cb3SPatrick Williams 3192b42cb3SPatrick WilliamsDEPENDS:append = "${@' gi-docgen-native gi-docgen' if d.getVar('GIDOCGEN_ENABLED') == 'True' else ''}" 3292b42cb3SPatrick Williams 33