Skip to contentSkip to conversation

meson: enable process reporting for do_compile

PATCH In review Ross Burton 1 participant 3 messages Jun 2, 2017 – Jun 5, 2017 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 meson: enable process reporting for do_compile

Ninja outputs progress information during a build (for example [12/34]) so we can tell bitbake how to parse this.

---
 meta-oe/classes/meson.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta-oe/classes/meson.bbclass +1 -0
index 5a04134..42f4005 100644
@@ -75,6 +75,7 @@ meson_do_configure() {
     fi
 }
 
+do_compile[progress] = "outof:^\[(\d+)/(\d+)\]"
 meson_do_compile() {
     ninja ${PARALLEL_MAKE}
 }
Signature · 1 line
2.8.1
#1 lore raw

PATCH 2/2 meson: set native tools

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.

---
 meta-oe/classes/meson.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
meta-oe/classes/meson.bbclass +7 -3
index 42f4005..0cf78e4 100644
@@ -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)
Signature · 1 line
2.8.1
#2 lore raw
In reply to Ross Burton

Just realised that my local master was out of date and these don't apply anymore, I'll rebase and resend.

Ross

Quoted 25 lines · Ross Burton

Ninja outputs progress information during a build (for example [12/34]) so we
can tell bitbake how to parse this.

---
 meta-oe/classes/meson.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta-oe/classes/meson.bbclass +1 -1
index 5a04134..42f4005 100644
@@ -75,6 +75,7 @@ meson_do_configure() {
     fi
 }
 
+do_compile[progress] = "outof:^\[(\d+)/(\d+)\]"
 meson_do_compile() {
     ninja ${PARALLEL_MAKE}
 }
--

2.8.1