[Mesa-dev] [RFC PATCH mesa 4/5] meson: store the result of whether we have gallium-extra-hud and lmsensors

Dylan Baker dylan at pnwbakers.com
Sat Feb 24 00:47:03 UTC 2018


Quoting Eric Engestrom (2018-02-23 10:08:47)
> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> ---
>  meson.build | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 6c22601f9e8864f08e08..770fdc7e50653bcfa7c2 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1187,15 +1187,19 @@ if with_platform_x11
>    endif
>  endif
>  
> +with_gallium_extra_hud = false
>  if get_option('gallium-extra-hud')
>    pre_args += '-DHAVE_GALLIUM_EXTRA_HUD=1'
> +  with_gallium_extra_hud = true
>  endif

I'm not a huge fan of flags like this, we can always call get_option() again in
this case.

>  
>  _sensors = get_option('lmsensors')
> +with_lmsensors = false
>  if _sensors != 'false'
>    dep_lmsensors = cc.find_library('libsensors', required : _sensors == 'true')
>    if dep_lmsensors.found()
>      pre_args += '-DHAVE_LIBSENSORS=1'
> +    with_lmsensors = true
>    endif
>  else
>    dep_lmsensors = []

In this case the flag is probably the right thing to do, we could always do
`dep_lmsensors != [] and dep_lmsensors.found()` but that's kinda ugly.

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180223/893078b7/attachment.sig>


More information about the mesa-dev mailing list