[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH] gobject-introspection: Add -Dintrospection only when GIR_MESON_OPTION is not empty
From:       "Khem Raj" <raj.khem () gmail ! com>
Date:       2021-11-12 0:59:23
Message-ID: 20211112005923.1237474-1-raj.khem () gmail ! com
[Download RAW message or body]

Content-Transfer-Encoding: 8bit

meson now does not allow unknown options which means we have to be
mindful of adding -Dintrospection unconditionally and provide an option
to recipes to set GIR_MESON_OPTION = "" and when recipe does that then
do not add -D<Dintrospection> option to meson. This will help recipes to
use meson 60.x+ just by adding

GIR_MESON_OPTION = ""

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/classes/gobject-introspection.bbclass | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta/classes/gobject-introspection.bbclass \
b/meta/classes/gobject-introspection.bbclass index 822a226d5f1..4db1b362d93 100644
--- a/meta/classes/gobject-introspection.bbclass
+++ b/meta/classes/gobject-introspection.bbclass
@@ -14,16 +14,18 @@ GIR_MESON_OPTION ?= 'introspection'
 GIR_MESON_ENABLE_FLAG ?= 'true'
 GIR_MESON_DISABLE_FLAG ?= 'false'
 
+# Define g-i options such that they can be disabled completely when GIR_MESON_OPTION \
is empty +GIRMESONTARGET = \
"-D${GIR_MESON_OPTION}=${@bb.utils.contains('GI_DATA_ENABLED', 'True', \
'${GIR_MESON_ENABLE_FLAG}', '${GIR_MESON_DISABLE_FLAG}', d)} " +GIRMESONBUILD = \
"-D${GIR_MESON_OPTION}=${GIR_MESON_DISABLE_FLAG} "  # 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', \
                '${GIR_MESON_ENABLE_FLAG}', '${GIR_MESON_DISABLE_FLAG}', d)} "
-
+EXTRA_OEMESON:prepend:class-target = "${@['', \
'${GIRMESONTARGET}'][d.getVar('GIR_MESON_OPTION') != '']}"  # 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}=${GIR_MESON_DISABLE_FLAG} "
-EXTRA_OEMESON:prepend:class-nativesdk = \
"-D${GIR_MESON_OPTION}=${GIR_MESON_DISABLE_FLAG} " \
+EXTRA_OEMESON:prepend:class-native = "${@['', \
'${GIRMESONBUILD}'][d.getVar('GIR_MESON_OPTION') != '']}" \
+EXTRA_OEMESON:prepend:class-nativesdk = "${@['', \
'${GIRMESONBUILD}'][d.getVar('GIR_MESON_OPTION') != '']}"  
 # Generating introspection data depends on a combination of native and target
 # introspection tools, and qemu to run the target tools.
-- 
2.33.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#158203): https://lists.openembedded.org/g/openembedded-core/message/158203
Mute This Topic: https://lists.openembedded.org/mt/86997027/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic