From 91b74ee03ada5d4517a5d8ef3895cc60f87780aa Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Wed, 13 Mar 2019 00:37:33 +0000 Subject: meson.bbclass: warn if cross property defaults are used The Meson idiom for checks which require running code on the target (which isn't possible in cross compilation) is to use a cross property, which the user can set in the cross file: if cc_can_run rres = cc.run(test_foo_code) have_foo = rres.compiled() and rres.returncode() == 0 else have_foo = meson.get_cross_property('have_foo', false) endif The default value may be overly conservative so we should review every property and explicitly set them as apppropriate. oe-core 669ddaf added a log message when the default value is used, so look for this message and emit a warning that the user will see. Signed-off-by: Ross Burton --- meta/classes/meson.bbclass | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'meta/classes') diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index 1ef34a999c..9c3673ea42 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass @@ -158,6 +158,15 @@ meson_do_configure_prepend_class-native() { export PKG_CONFIG="pkg-config-native" } +python meson_do_qa_configure() { + import re + warn_re = re.compile(r"^WARNING: Cross property (.+) is using default value (.+)$", re.MULTILINE) + log = open(d.expand("${B}/meson-logs/meson-log.txt")).read() + for (prop, value) in warn_re.findall(log): + bb.warn("Meson cross property %s used without explicit assignment, defaulting to %s" % (prop, value)) +} +do_configure[postfuncs] += "meson_do_qa_configure" + do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" meson_do_compile() { ninja -v ${PARALLEL_MAKE} -- cgit 1.2.3-korg