aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2018-02-20 14:16:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-24 10:31:35 +0000
commitabcb330c462c2c06d36f8f3681a6bd07d562c1fe (patch)
tree7708a5082e152f68cfe3ece626bcc77f6718504e
parent0e45643f24222ea221869e7282489660bac22c6b (diff)
downloadopenembedded-core-contrib-abcb330c462c2c06d36f8f3681a6bd07d562c1fe.tar.gz
openembedded-core-contrib-abcb330c462c2c06d36f8f3681a6bd07d562c1fe.tar.bz2
openembedded-core-contrib-abcb330c462c2c06d36f8f3681a6bd07d562c1fe.zip
meson.bbclass: Add support for nativesdk
We need to use the meson.cross file when building for nativesdk. Additionally, we need to trick meson's sanity tests, just as it is done for target builds. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/meson.bbclass13
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index cd3497a802d..31d32a56f64 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -39,6 +39,7 @@ EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}"
MESON_CROSS_FILE = ""
MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
+MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
CCOMPILER ?= "gcc"
CXXCOMPILER ?= "g++"
@@ -105,6 +106,18 @@ meson_do_configure_prepend_class-target() {
export AR="${BUILD_AR}"
}
+meson_do_configure_prepend_class-nativesdk() {
+ # Set these so that meson uses the native tools for its build sanity tests,
+ # which require executables to be runnable. The cross file will still
+ # override these for the nativesdk build. Note that we do *not* set CFLAGS,
+ # LDFLAGS, etc. as they will be slurped in by meson and applied to the
+ # nativesdk build, causing errors.
+ export CC="${BUILD_CC}"
+ export CXX="${BUILD_CXX}"
+ export LD="${BUILD_LD}"
+ export AR="${BUILD_AR}"
+}
+
meson_do_configure_prepend_class-native() {
export PKG_CONFIG="pkg-config-native"
}