• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2017-2018 Intel Corporation
2# SPDX-License-Identifier: MIT
3
4clover_cpp_args = []
5clover_opencl_cpp_args = [
6  '-DCL_TARGET_OPENCL_VERSION=300',
7  '-DCL_USE_DEPRECATED_OPENCL_1_0_APIS',
8  '-DCL_USE_DEPRECATED_OPENCL_1_1_APIS',
9  '-DCL_USE_DEPRECATED_OPENCL_1_2_APIS',
10  '-DCL_USE_DEPRECATED_OPENCL_2_0_APIS',
11  '-DCL_USE_DEPRECATED_OPENCL_2_1_APIS',
12  '-DCL_USE_DEPRECATED_OPENCL_2_2_APIS',
13  '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'includedir')),
14  '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'libexecdir'))
15]
16clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
17
18# the CL header files declare attributes on the CL types. Compilers warn if
19# we use them as template arguments. Disable the warning as there isn't
20# anything we can do about it
21if cpp.has_argument('-Wno-ignored-attributes')
22   clover_cpp_args += '-Wno-ignored-attributes'
23endif
24
25if with_opencl_icd
26  clover_cpp_args += '-DHAVE_CLOVER_ICD'
27endif
28
29libclllvm = static_library(
30  'clllvm',
31  files(
32    'llvm/codegen/bitcode.cpp',
33    'llvm/codegen/common.cpp',
34    'llvm/codegen/native.cpp',
35    'llvm/codegen.hpp',
36    'llvm/compat.hpp',
37    'llvm/invocation.cpp',
38    'llvm/invocation.hpp',
39    'llvm/metadata.hpp',
40    'llvm/util.hpp',
41  ),
42  include_directories : clover_incs,
43  cpp_args : [
44    clover_cpp_args,
45    clover_opencl_cpp_args,
46    '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
47      dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
48      dep_llvm.version(), 'include',
49    )),
50  ],
51  gnu_symbol_visibility : 'hidden',
52  dependencies : [dep_llvm, dep_elf, dep_llvmspirvlib, idep_mesautil],
53)
54
55clover_files = files(
56  'api/context.cpp',
57  'api/device.cpp',
58  'api/dispatch.cpp',
59  'api/dispatch.hpp',
60  'api/event.cpp',
61  'api/interop.cpp',
62  'api/invalid.cpp',
63  'api/kernel.cpp',
64  'api/memory.cpp',
65  'api/platform.cpp',
66  'api/program.cpp',
67  'api/queue.cpp',
68  'api/sampler.cpp',
69  'api/transfer.cpp',
70  'api/util.hpp',
71  'core/binary.cpp',
72  'core/binary.hpp',
73  'core/compiler.hpp',
74  'core/context.cpp',
75  'core/context.hpp',
76  'core/device.cpp',
77  'core/device.hpp',
78  'core/error.hpp',
79  'core/event.cpp',
80  'core/event.hpp',
81  'core/format.cpp',
82  'core/format.hpp',
83  'core/kernel.cpp',
84  'core/kernel.hpp',
85  'core/memory.cpp',
86  'core/memory.hpp',
87  'core/object.hpp',
88  'core/platform.cpp',
89  'core/platform.hpp',
90  'core/printf.cpp',
91  'core/printf.hpp',
92  'core/program.cpp',
93  'core/program.hpp',
94  'core/property.hpp',
95  'core/queue.cpp',
96  'core/queue.hpp',
97  'core/resource.cpp',
98  'core/resource.hpp',
99  'core/sampler.cpp',
100  'core/sampler.hpp',
101  'core/timestamp.cpp',
102  'core/timestamp.hpp',
103  'util/adaptor.hpp',
104  'util/algebra.hpp',
105  'util/algorithm.hpp',
106  'util/compat.hpp',
107  'util/factor.hpp',
108  'util/functional.hpp',
109  'util/lazy.hpp',
110  'util/pointer.hpp',
111  'util/range.hpp',
112  'util/tuple.hpp',
113)
114
115libclover = static_library(
116  'clover',
117  [clover_files, sha1_h],
118  include_directories : clover_incs,
119  cpp_args : [
120    clover_opencl_cpp_args,
121    clover_cpp_args,
122  ],
123  gnu_symbol_visibility : 'hidden',
124  link_with : [libclllvm],
125  dependencies : [idep_mesautil, idep_nir],
126)
127