1 # Copyright © 2017-2018 Intel Corporation
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 clover_spirv_cpp_args = []
23 clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
25 # the CL header files declare attributes on the CL types. Compilers warn if
26 # we use them as template arguments. Disable the warning as there isn't
27 # anything we can do about it
28 if cpp.has_argument('-Wno-ignored-attributes')
29 clover_cpp_args += '-Wno-ignored-attributes'
33 clover_cpp_args += '-DHAVE_CLOVER_ICD'
37 clover_spirv_cpp_args += '-DHAVE_CLOVER_SPIRV'
40 libclllvm = static_library(
43 'llvm/codegen/bitcode.cpp',
44 'llvm/codegen/common.cpp',
45 'llvm/codegen/native.cpp',
48 'llvm/invocation.cpp',
49 'llvm/invocation.hpp',
53 include_directories : clover_incs,
56 clover_spirv_cpp_args,
58 '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir')),
59 '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('libexecdir')),
60 '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
61 dep_llvm.get_configtool_variable('libdir'), 'clang',
62 dep_llvm.version(), 'include',
65 dependencies : [dep_llvm, dep_elf, dep_llvmspirvlib],
66 override_options : clover_cpp_std,
69 libclspirv = static_library(
71 files('spirv/invocation.cpp', 'spirv/invocation.hpp'),
72 include_directories : clover_incs,
73 cpp_args : [clover_spirv_cpp_args, cpp_vis_args],
74 dependencies : [dep_spirv_tools],
75 override_options : clover_cpp_std,
78 libclnir = static_library(
80 [files('nir/invocation.cpp', 'nir/invocation.hpp'), nir_opcodes_h],
81 include_directories : [clover_incs, inc_mesa],
82 cpp_args : [clover_spirv_cpp_args, cpp_vis_args],
84 override_options : clover_cpp_std,
130 'core/timestamp.cpp',
131 'core/timestamp.hpp',
134 'util/algorithm.hpp',
136 'util/functional.hpp',
143 libclover = static_library(
145 [clover_files, sha1_h],
146 include_directories : clover_incs,
147 cpp_args : [clover_spirv_cpp_args, clover_cpp_args, cpp_vis_args],
148 link_with : [libclllvm, libclspirv, libclnir],
149 override_options : clover_cpp_std,