Reviewed-by: Karol Herbst <kher...@redhat.com> Reviewed-by: Dylan Baker <dy...@pnwbakers.com> Signed-off-by: Pierre Moreau <pierre.mor...@free.fr> ---
Notes: Changes in: * v8: * Properly align LLVMSPIRVLib comment (Dylan Baker) * Only define CLOVER_ALLOW_SPIRV when **both** dependencies are found: autotools was only requiring one or the other. * 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..f615d98645e 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 -a \ + "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..f35c86a9b91 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 + 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.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev