diff mbox series

[1/3] classes/meson: use ninja explicitly when compiling

Message ID 20260629141559.1305873-1-ross.burton@arm.com
State Under Review
Headers show
Series [1/3] classes/meson: use ninja explicitly when compiling | expand

Commit Message

Ross Burton June 29, 2026, 2:15 p.m. UTC
"meson compile" is essentially a glorified wrapper around calling ninja
that doesn't support all of the options that ninja does, so calling it
directly means builds are fractionally faster and we get direct control
over the flags that ninja is passed.

A longer rationale can be found in the Gentoo change by Eli Schwartz
that caused this patch, who is both a Gentoo and Meson developer:

https://github.com/gentoo/gentoo/commit/66011abd663671947fe07835f0d9cc360f5de317

The only change is that the compile target doesn't support the optional
convenience target type, but this is rarely used.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-recipe/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Khem Raj June 29, 2026, 2:32 p.m. UTC | #1
On Mon, Jun 29, 2026, 7:16 AM Ross Burton via lists.openembedded.org
<ross.burton=arm.com@lists.openembedded.org> wrote:

> "meson compile" is essentially a glorified wrapper around calling ninja
> that doesn't support all of the options that ninja does, so calling it
> directly means builds are fractionally faster and we get direct control
> over the flags that ninja is passed.
>
> A longer rationale can be found in the Gentoo change by Eli Schwartz
> that caused this patch, who is both a Gentoo and Meson developer:
>
>
> https://github.com/gentoo/gentoo/commit/66011abd663671947fe07835f0d9cc360f5de317
>
> The only change is that the compile target doesn't support the optional
> convenience target type, but this is rarely used.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/classes-recipe/meson.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/meson.bbclass
> b/meta/classes-recipe/meson.bbclass
> index 9bed293603c..a4643591103 100644
> --- a/meta/classes-recipe/meson.bbclass
> +++ b/meta/classes-recipe/meson.bbclass
> @@ -180,7 +180,7 @@ meson_do_configure() {
>
>  do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
>  meson_do_compile() {
> -    meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET}
> +    ninja --verbose ${PARALLEL_MAKE}


Like cmake verbose could be a configurable knob since its being added by
this patch

${MESON_TARGET}
>  }
>
>  meson_do_install() {
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#239785):
> https://lists.openembedded.org/g/openembedded-core/message/239785
> Mute This Topic: https://lists.openembedded.org/mt/120030899/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Ross Burton June 29, 2026, 3:57 p.m. UTC | #2
On 29 Jun 2026, at 15:32, Khem Raj <raj.khem@gmail.com> wrote:
> Like cmake verbose could be a configurable knob since its being added by this patch

-v was already an option, but I’m a bit meh on adding options to make the logs useful.

Ross
Khem Raj June 29, 2026, 6:17 p.m. UTC | #3
Sometimes they can make non trivial difference in compile time of they are
large projects

On Mon, Jun 29, 2026, 8:58 AM Ross Burton <Ross.Burton@arm.com> wrote:

> On 29 Jun 2026, at 15:32, Khem Raj <raj.khem@gmail.com> wrote:
> > Like cmake verbose could be a configurable knob since its being added by
> this patch
>
> -v was already an option, but I’m a bit meh on adding options to make the
> logs useful.
>
> Ross
diff mbox series

Patch

diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
index 9bed293603c..a4643591103 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -180,7 +180,7 @@  meson_do_configure() {
 
 do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
 meson_do_compile() {
-    meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET}
+    ninja --verbose ${PARALLEL_MAKE} ${MESON_TARGET}
 }
 
 meson_do_install() {