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_opencl_cpp_args = [
23 '-DCL_TARGET_OPENCL_VERSION=220',
24 '-DCL_USE_DEPRECATED_OPENCL_1_0_APIS',
25 '-DCL_USE_DEPRECATED_OPENCL_1_1_APIS',
26 '-DCL_USE_DEPRECATED_OPENCL_1_2_APIS',
27 '-DCL_USE_DEPRECATED_OPENCL_2_0_APIS',
28 '-DCL_USE_DEPRECATED_OPENCL_2_1_APIS'
30 clover_spirv_cpp_args = []
31 clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
33 # the CL header files declare attributes on the CL types. Compilers warn if
34 # we use them as template arguments. Disable the warning as there isn't
35 # anything we can do about it
36 if cpp.has_argument('-Wno-ignored-attributes')
37 clover_cpp_args += '-Wno-ignored-attributes'
41 clover_cpp_args += '-DHAVE_CLOVER_ICD'
45 clover_spirv_cpp_args += '-DHAVE_CLOVER_SPIRV'
48 libclllvm = static_library(
51 'llvm/codegen/bitcode.cpp',
52 'llvm/codegen/common.cpp',
53 'llvm/codegen/native.cpp',
56 'llvm/invocation.cpp',
57 'llvm/invocation.hpp',
61 include_directories : clover_incs,
64 clover_opencl_cpp_args,
65 clover_spirv_cpp_args,
66 '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir')),
67 '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('libexecdir')),
68 '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
69 dep_llvm.get_configtool_variable('libdir'), 'clang',
70 dep_llvm.version(), 'include',
73 gnu_symbol_visibility : 'hidden',
74 dependencies : [dep_llvm, dep_elf, dep_llvmspirvlib],
77 libclspirv = static_library(
79 files('spirv/invocation.cpp', 'spirv/invocation.hpp'),
80 include_directories : clover_incs,
81 cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args],
82 gnu_symbol_visibility : 'hidden',
83 dependencies : [dep_spirv_tools],
86 libclnir = static_library(
88 files('nir/invocation.cpp', 'nir/invocation.hpp'),
89 include_directories : [clover_incs, inc_mesa],
90 dependencies : idep_nir,
91 cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args],
92 gnu_symbol_visibility : 'hidden',
138 'core/timestamp.cpp',
139 'core/timestamp.hpp',
142 'util/algorithm.hpp',
144 'util/functional.hpp',
151 libclover = static_library(
153 [clover_files, sha1_h],
154 include_directories : clover_incs,
156 clover_opencl_cpp_args,
157 clover_spirv_cpp_args,
160 gnu_symbol_visibility : 'hidden',
161 link_with : [libclllvm, libclspirv, libclnir],