[OE-core] [PATCH] meson: Adjust for clang compiler

Richard Purdie richard.purdie at linuxfoundation.org
Mon Jan 29 23:07:38 UTC 2018


On Mon, 2018-01-29 at 09:44 -0800, Khem Raj wrote:
> On Mon, Jan 29, 2018 at 9:21 AM, Burton, Ross <ross.burton at intel.com>
> wrote:
> > 
> > On 27 January 2018 at 07:06, Khem Raj <raj.khem at gmail.com> wrote:
> > > 
> > > 
> > > Remove hardcoding c/c++ compiler to be gcc alone, its
> > > possible to use clang as replacement for cross compilers
> > > from meta-clang, therefore set clang/clang++ if
> > > TOOLCHAIN = "clang"
> > > 
> > > Signed-off-by: Khem Raj <raj.khem at gmail.com>
> > > ---
> > >  meta/classes/meson.bbclass | 9 +++++++--
> > >  1 file changed, 7 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/meta/classes/meson.bbclass
> > > b/meta/classes/meson.bbclass
> > > index 91ac652651..cd3497a802 100644
> > > --- a/meta/classes/meson.bbclass
> > > +++ b/meta/classes/meson.bbclass
> > > @@ -40,6 +40,11 @@ EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}"
> > >  MESON_CROSS_FILE = ""
> > >  MESON_CROSS_FILE_class-target = "--cross-file
> > > ${WORKDIR}/meson.cross"
> > > 
> > > +CCOMPILER ?= "gcc"
> > > +CXXCOMPILER ?= "g++"
> > > +CCOMPILER_toolchain-clang = "clang"
> > > +CXXCOMPILER_toolchain-clang = "clang++"
> > > +
> > 
> > Can we do this in bitbake.conf instead of repeating ourselves?
> having it in meson bbclass keeps it to meson based recipes,
> bitbake.conf is a bit too generic.

Yes, I do worry a bit about namespace pollution from bitbake.conf
already...

Cheers,

Richard





More information about the Openembedded-core mailing list