diff options
author | Ross Burton <ross.burton@intel.com> | 2019-03-13 00:37:33 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-27 16:48:08 +0000 |
commit | 5fd2619c6ed417160874fc00996d11b186171c0b (patch) | |
tree | 2d4486d044ef45424c4b7006a1e0151f29dc8860 /meta | |
parent | 957445e7c541476720cccbc8c0a930cbea1133f5 (diff) | |
download | poky-5fd2619c6ed417160874fc00996d11b186171c0b.tar.gz |
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.
(From OE-Core rev: 91b74ee03ada5d4517a5d8ef3895cc60f87780aa)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/meson.bbclass | 9 |
1 files changed, 9 insertions, 0 deletions
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() { | |||
158 | export PKG_CONFIG="pkg-config-native" | 158 | export PKG_CONFIG="pkg-config-native" |
159 | } | 159 | } |
160 | 160 | ||
161 | python meson_do_qa_configure() { | ||
162 | import re | ||
163 | warn_re = re.compile(r"^WARNING: Cross property (.+) is using default value (.+)$", re.MULTILINE) | ||
164 | log = open(d.expand("${B}/meson-logs/meson-log.txt")).read() | ||
165 | for (prop, value) in warn_re.findall(log): | ||
166 | bb.warn("Meson cross property %s used without explicit assignment, defaulting to %s" % (prop, value)) | ||
167 | } | ||
168 | do_configure[postfuncs] += "meson_do_qa_configure" | ||
169 | |||
161 | do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" | 170 | do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" |
162 | meson_do_compile() { | 171 | meson_do_compile() { |
163 | ninja -v ${PARALLEL_MAKE} | 172 | ninja -v ${PARALLEL_MAKE} |