[Mesa-dev] [PATCH 2/3] meson: Add lmsensors support

Dylan Baker dylan at pnwbakers.com
Wed Nov 29 17:20:23 UTC 2017


Quoting Eric Engestrom (2017-11-29 06:41:32)
> On Tuesday, 2017-11-28 16:56:38 -0800, Dylan Baker wrote:
> > Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> > ---
> >  meson.build                               | 11 +++++++++++
> >  meson_options.txt                         |  7 +++++++
> >  src/gallium/drivers/etnaviv/meson.build   |  2 +-
> >  src/gallium/drivers/freedreno/meson.build |  1 +
> >  src/gallium/drivers/nouveau/meson.build   |  2 +-
> >  src/gallium/drivers/r300/meson.build      |  4 +++-
> >  src/gallium/targets/dri/meson.build       |  2 +-
> >  7 files changed, 25 insertions(+), 4 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index e3c201d7b87..e797f04eade 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -919,6 +919,17 @@ endif
> >  if get_option('gallium-extra-hud')
> >    pre_args += '-DHAVE_GALLIUM_EXTRA_HUD=1'
> >  endif
> > +_sensors = get_option('lmsensors')
> > +if _sensors == 'auto'
> > +  dep_lmsensors = cc.find_library('libsensors', required : false)
> > +  if dep_lmsensors.found()
> > +    pre_args += '-DHAVE_LIBSENSORS=1'
> > +  endif
> > +elif _sensors == 'true'
> > +  dep_lmsensors = cc.find_library('libsensors')
> > +  pre_args += '-DHAVE_LIBSENSORS=1'
> > +endif
> 
> I'd write it like this maybe?
> 
>   _sensors = get_option('lmsensors')
>   if _sensors != 'false'
>     dep_lmsensors = cc.find_library('libsensors', required : _sensors == 'true')
>     if dep_lmsensors.found()
>       pre_args += '-DHAVE_LIBSENSORS=1'
>     endif
>   endif

I was thinking about that, but for some reason didn't do it. I'll make that
change, I like that better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171129/8ef8d075/attachment.sig>


More information about the mesa-dev mailing list