[Mesa-stable] [PATCH v2 2/2] meson: swr: do a second llvm search with extra modules for llvm >= 7

Dylan Baker dylan at pnwbakers.com
Mon Sep 24 20:09:24 UTC 2018


Quoting Chuck Atkins (2018-09-24 12:58:26)
> Signed-off-by: Chuck Atkins <chuck.atkins at kitware.com>
> CC: <mesa-stable at lists.freedesktop.org>
> CC: Dylan Baker <dylan at pnwbakers.com>
> CC: Bruce Cherniak <bruce.cherniak at intel.com>
> CC: Tim Rowley <timothy.o.rowley at intel.com>
> ---
>  meson.build | 37 ++++++++++++++++++++++++-------------
>  1 file changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index cbf88b5013..a7e03c29dc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1160,27 +1160,38 @@ else
>  endif
>  
>  _llvm = get_option('llvm')
> -if _llvm == 'auto'
> +if _llvm == 'false'
> +  dep_llvm = null_dep
> +  with_llvm = false
> +else
> +  _llvm_req = true
> +  if _llvm == 'auto'
> +    _llvm_req = with_amd_vk or with_gallium_radeonsi or with_gallium_swr or with_gallium_opencl
> +  endif
>    dep_llvm = dependency(
>      'llvm',
>      version : _llvm_version,
>      modules : llvm_modules,
>      optional_modules : llvm_optional_modules,
> -    required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or with_gallium_opencl,
> +    required : _llvm_req,
>    )
> +  _llvm_2pass = false

I think you could simplify this:

> +  if dep_llvm.found() and with_gallium_swr and dep_llvm.version().version_compare('>= 7')
> +    _llvm_2pass = true
> +    llvm_modules += ['ipo', 'objcarcopts']
> +  endif
> +  if _llvm_2pass
> +    dep_llvm = dependency(
> +      'llvm',
> +      version : _llvm_version,
> +      modules : llvm_modules,
> +      optional_modules : llvm_optional_modules,
> +      required : _llvm_req,
> +    )
> +  endif

if dep_llvm.found() and with_gallium_swr and dep_llvm.version().version_compare('>= 7')
  llvm_modules += ['ipo', 'objcarcopts']
  dep_llvm = dependency(
    'llvm',
    version : _llvm_version,
    modules : llvm_modules,
    optional_modules : llvm_optional_modules,
    required : _llvm_req,
  )
endif
with_llvm = dep_llvm.found()

Could you also mention this upstream bug: https://github.com/mesonbuild/meson/issues/4253?

I also pushed a patch that did away with the duplication between auto and true
just before reviewing this :/

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-stable/attachments/20180924/3a0f41b7/attachment.sig>


More information about the mesa-stable mailing list