Il gio 6 ago 2020, 23:02 Peter Maydell <peter.mayd...@linaro.org> ha
scritto:

> On Thu, 6 Aug 2020 at 21:10, Paolo Bonzini <pbonz...@redhat.com> wrote:
> >
> > From: Marc-André Lureau <marcandre.lur...@redhat.com>
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
> > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
>
> Compared to:
>
> > -common-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o
>
> > +softmmu_ss.add(when: 'CONFIG_HEATHROW_PIC', if_true:
> files('heathrow_pic.c'))
>
> this feels pretty clunky. Doesn't Meson have a nicer
> way of expressing this kind of thing?


Nope, in fact it turns out we had to implement it ourselves because there
was no way to express it at all in the way that QEMU build multiple
binaries. My initial version didn't have the when/if_true part but the
maintainer was quite adamant on requiring them instead of just relying on
positional arguments.

Unfortunately, while common in QEMU, and in Linux too, it doesn't seem to
be a very common idiom in general; Makefiles do express it in a very
readable and concise way.

I cannot deny it looks clunky. While Meson does have a huge advantage in
terms of predictability and lack of surprises when doing harder things, the
imperative syntax is heavier when dealing with the simplest. They do remain
simple (it's still one line of coffee), but the quotes and commas seem to
be enough to "switch" our brain to a different mode.

My opinion is that you don't really look at these things very much, so it
doesn't really matter, but I can see people disagreeing.

(You had already pointed this out during the very first discussions, if I
remember correctly. I can't add much except that with extra experience the
balance does tilt in favor of Meson despite the heavier syntax for simple
cases).

Paolo

It's really
> common and I'd hope that a build system language
> would provide less long-winded ways to write common
> operations...
>
> thanks
> -- PMM
>
>

Reply via email to