[oe] [PATCH 2/2] meson: set native tools
Ross Burton
ross.burton at intel.com
Fri Jun 2 15:55:16 UTC 2017
When cross-compiling meson respects the usual CC, CFLAGS and so on environment
variables for *native* tools not *cross* tools, so instead of unexporting CC we
should re-export the right tools.
Not only is this the right thing to do, but recent changes to oe-core means that
the default compiler binary (cc) isn't in PATH, so Meson can't build native
binaries.
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
meta-oe/classes/meson.bbclass | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/meta-oe/classes/meson.bbclass b/meta-oe/classes/meson.bbclass
index 42f4005..0cf78e4 100644
--- a/meta-oe/classes/meson.bbclass
+++ b/meta-oe/classes/meson.bbclass
@@ -9,9 +9,13 @@ 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
+CPPFLAGS = "${BUILD_CPPFLAGS}"
+CC = "${BUILD_CC}"
+CFLAGS = "${BUILD_CFLAGS}"
+CXX = "${BUILD_CXX}"
+CXXFLAGS = "${BUILD_CXXFLAGS}"
+LDFLAGS = "${BUILD_LDFLAGS}"
def noprefix(var, d):
return d.getVar(var, True).replace(d.getVar('prefix', True) + '/', '', 1)
--
2.8.1
More information about the Openembedded-devel
mailing list