[OE-core] [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson

Andreas Müller schnitzeltony at gmail.com
Mon Apr 1 16:01:06 UTC 2019


Signed-off-by: Andreas Müller <schnitzeltony at gmail.com>
---
V1 -> V2: Introduce GIR_MESON_OPTION as suggested by Alexander Kanavin
 meta/classes/gobject-introspection.bbclass | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/meta/classes/gobject-introspection.bbclass b/meta/classes/gobject-introspection.bbclass
index 4ceb0c68b1..d3c92e0d7a 100644
--- a/meta/classes/gobject-introspection.bbclass
+++ b/meta/classes/gobject-introspection.bbclass
@@ -6,14 +6,26 @@
 # This also sets up autoconf-based recipes to build introspection data (or not),
 # depending on distro and machine features (see gobject-introspection-data class).
 inherit python3native gobject-introspection-data
+
+# meson: default option name to enable/disable introspection. This matches most
+# project's configuration. In doubts - check meson_options.txt in project's
+# source path.
+GIR_MESON_OPTION ?= 'introspection'
+
+# Auto enable/disable based on GI_DATA_ENABLED
 EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} "
+EXTRA_OEMESON_prepend_class-target = "-D${GIR_MESON_OPTION}=${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'true', 'false', d)} "
 
 # When building native recipes, disable introspection, as it is not necessary,
 # pulls in additional dependencies, and makes build times longer
 EXTRA_OECONF_prepend_class-native = "--disable-introspection "
 EXTRA_OECONF_prepend_class-nativesdk = "--disable-introspection "
+EXTRA_OEMESON_prepend_class-native = "-D${GIR_MESON_OPTION}=False "
+EXTRA_OEMESON_prepend_class-nativesdk = "-D${GIR_MESON_OPTION}=False "
 
-UNKNOWN_CONFIGURE_WHITELIST_append = " --enable-introspection --disable-introspection"
+# Avoid triggering configure QA
+UNKNOWN_CONFIGURE_WHITELIST_append = " ${@["", "--enable-introspection --disable-introspection"][(bb.data.inherits_class('autotools', d))]}"
+UNKNOWN_CONFIGURE_WHITELIST_append = " ${@["", "${GIR_MESON_OPTION}"][(bb.data.inherits_class('meson', d))]}"
 
 # Generating introspection data depends on a combination of native and target
 # introspection tools, and qemu to run the target tools.
-- 
2.20.1



More information about the Openembedded-core mailing list