meson: Check for SPIRV-Tools and llvm-spirv

Changes since:
* v12 (Karol Herbst):
  - rename CLOVER_ALLOW_SPIRV to HAVE_CLOVER_SPIRV
* v11 (Karol Herbst):
  - only set new defines for clover to speed up recompilation
  - remove autotools
* v10:
  - Add a new flag (`--enable-opencl-spirv` for autotools, and
    `-Dopencl-spirv=true` for meson) for enabling SPIR-V support in
    clover, and never automagically enable it without that flag. (Dylan Baker)
  - When enabling the SPIR-V support, the SPIRV-Tools and
    SPIRV-LLVM-Translator libraries are now required dependencies.
* v7:
  - Properly align LLVMSPIRVLib comment (Dylan Baker)
  - Only define CLOVER_ALLOW_SPIRV when **both** dependencies are found:
    autotools was only requiring one or the other.
* v6: Replace the llvm-spirv repository by the new official
      SPIRV-LLVM-Translator.
* v4: Add a comment saying where to find llvm-spirv (Karol Herbst).
* v3:
  - make SPIRV-Tools and llvm-spirv optional (Francisco Jerez);
  - bump requirement for llvm-spirv to version 0.2
* v2:
  - Bump the required version of SPIRV-Tools to the latest release;
  - Add a dependency on llvm-spirv.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com> (v10)
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
Pierre Moreau
2018-01-21 19:10:58 +01:00
committed by Karol Herbst
parent aa7ac32976
commit 866f6f11d9
3 changed files with 26 additions and 2 deletions

View File

@@ -712,6 +712,16 @@ if _opencl != 'disabled'
with_gallium_opencl = true
with_opencl_icd = _opencl == 'icd'
with_opencl_spirv = get_option('opencl-spirv')
if with_opencl_spirv
dep_spirv_tools = dependency('SPIRV-Tools', required : true, version : '>= 2018.0')
# LLVMSPIRVLib is available at https://github.com/KhronosGroup/SPIRV-LLVM-Translator
dep_llvmspirvlib = dependency('LLVMSPIRVLib', required : true, version : '>= 0.2.1')
else
dep_spirv_tools = null_dep
dep_llvmspirvlib = null_dep
endif
if host_machine.cpu_family().startswith('ppc') and cpp.compiles('''
#if !defined(__VEC__) || !defined(__ALTIVEC__)
#error "AltiVec not enabled"
@@ -721,8 +731,11 @@ if _opencl != 'disabled'
endif
else
dep_clc = null_dep
dep_spirv_tools = null_dep
dep_llvmspirvlib = null_dep
with_gallium_opencl = false
with_opencl_icd = false
with_opencl_spirv = false
endif
gl_pkgconfig_c_flags = []