[Mesa-dev] [PATCH v7 13/21] configure.ac, meson: Check for SPIRV-Tools and llvm-spirv
Dylan Baker
dylan at pnwbakers.com
Wed May 23 22:51:31 UTC 2018
Quoting Pierre Moreau (2018-05-23 14:43:10)
> Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
> ---
> Changes in:
> - v7: Replace the llvm-spirv repository by the new official
> SPIRV-LLVM-Translator
>
> configure.ac | 18 ++++++++++++++++++
> meson.build | 8 ++++++++
> 2 files changed, 26 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index 62063c1c8a7..2cb28c283ac 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2439,6 +2439,24 @@ AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
> AC_SUBST([OPENCL_LIBNAME])
> AC_SUBST([CLANG_RESOURCE_DIR])
>
> +AS_IF([test "x$enable_opencl" = xyes], [
> + PKG_CHECK_MODULES([SPIRV_TOOLS], [SPIRV-Tools >= 2018.0],
> + [have_spirv_tools=yes], [have_spirv_tools=no])])
> +AC_SUBST([SPIRV_TOOLS_CFLAGS])
> +AC_SUBST([SPIRV_TOOLS_LIBS])
> +
> +# LLVMSPIRVLib is available at https://github.com/KhronosGroup/SPIRV-LLVM-Translator
> +AS_IF([test "x$enable_opencl" = xyes], [
> + PKG_CHECK_MODULES([LLVMSPIRVLIB], [LLVMSPIRVLib >= 0.2.1],
> + [have_llvmspirvlib=yes], [have_llvmspirvlib=no])])
> +AC_SUBST([LLVMSPIRVLIB_CFLAGS])
> +AC_SUBST([LLVMSPIRVLIB_LIBS])
> +
> +if test "x$have_spirv_tools" = xyes -o \
> + "x$have_llvmspirvlib" = xyes; then
> + DEFINES="$DEFINES -DCLOVER_ALLOW_SPIRV"
> +fi
> +
> dnl
> dnl Gallium configuration
> dnl
> diff --git a/meson.build b/meson.build
> index d0cb8961638..3fa24a64676 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -639,10 +639,18 @@ if _opencl != 'disabled'
>
> # TODO: alitvec?
> dep_clc = dependency('libclc')
> + dep_spirv_tools = dependency('SPIRV-Tools', required : false, version : '>= 2018.0')
> +# LLVMSPIRVLib is available at https://github.com/KhronosGroup/SPIRV-LLVM-Translator
The # should line up with the d in dep, I know that vim does the wrong thing
here, I just haven't fixed it yet.
Also, thank you so much for adding pkg-config support for this. LLVM is a huge headache
as a dependency because of llvm-config.
With that fixed, this patch is:
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
> + dep_llvmspirvlib = dependency('LLVMSPIRVLib', required : false, version : '>= 0.2.1')
> + if dep_spirv_tools.found() and dep_llvmspirvlib.found()
> + pre_args += '-DCLOVER_ALLOW_SPIRV'
> + endif
> with_gallium_opencl = true
> with_opencl_icd = _opencl == 'icd'
> else
> dep_clc = null_dep
> + dep_spirv_tools = null_dep
> + dep_llvmspirvlib = null_dep
> with_gallium_opencl = false
> with_gallium_icd = false
> endif
> --
> 2.17.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- 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/20180523/9fb1ba20/attachment-0001.sig>
More information about the mesa-dev
mailing list