aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/classes
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2017-03-11 05:58:54 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2017-03-16 23:32:40 +0100
commit7fb45590ff7d10b4a32a6f702b79ab855fd62948 (patch)
tree20dc2cef278887c8d7dedee602c87139980c5d78 /meta-oe/classes
parent08164e4c9d8347b06b170b73228aacbc701314ce (diff)
downloadmeta-openembedded-7fb45590ff7d10b4a32a6f702b79ab855fd62948.tar.gz
meta-openembedded-7fb45590ff7d10b4a32a6f702b79ab855fd62948.tar.bz2
meta-openembedded-7fb45590ff7d10b4a32a6f702b79ab855fd62948.zip
meson.bbclass: Support building for native
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/classes')
-rw-r--r--meta-oe/classes/meson.bbclass13
1 files changed, 9 insertions, 4 deletions
diff --git a/meta-oe/classes/meson.bbclass b/meta-oe/classes/meson.bbclass
index 8da06da7f..e3489dd12 100644
--- a/meta-oe/classes/meson.bbclass
+++ b/meta-oe/classes/meson.bbclass
@@ -9,9 +9,11 @@ do_configure[cleandirs] = "${B}"
# Where the meson.build build configuration is
MESON_SOURCEPATH = "${S}"
-# These variables in the environment override the *native* tools not the cross,
-# so they need to be unexported.
-CC[unexport] = "1"
+# These variables in the environment override the *native* tools, not the cross.
+export CC = "${BUILD_CC}"
+export CXX = "${BUILD_CXX}"
+export LD = "${BUILD_LD}"
+export AR = "${BUILD_AR}"
def noprefix(var, d):
return d.getVar(var, True).replace(d.getVar('prefix', True) + '/', '', 1)
@@ -37,6 +39,9 @@ MESON_TARGET_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'big',
EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}"
+MESON_CROSS_FILE = ""
+MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
+
def meson_array(var, d):
return "', '".join(d.getVar(var, True).split()).join(("'", "'"))
@@ -75,7 +80,7 @@ EOF
CONFIGURE_FILES = "meson.build"
meson_do_configure() {
- if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" --cross-file ${WORKDIR}/meson.cross ${EXTRA_OEMESON}; then
+ if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then
cat ${B}/meson-logs/meson-log.txt
bbfatal_log meson failed
fi