diff mbox series

[oe,2/2] meson: set native tools

Message ID 1496418916-17305-2-git-send-email-ross.burton@intel.com
State New
Headers show
Series [oe,1/2] meson: enable process reporting for do_compile | expand

Commit Message

Ross Burton June 2, 2017, 3:55 p.m. UTC
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@intel.com>

---
 meta-oe/classes/meson.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

-- 
2.8.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

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)