1# Copyright © 2017-2018 Intel Corporation
2
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:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
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
19# SOFTWARE.
20
21clover_cpp_args = []
22clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
23
24if with_opencl_icd
25  clover_cpp_args += '-DHAVE_CLOVER_ICD'
26endif
27
28libcltgsi = static_library(
29  'cltgsi',
30  files('tgsi/compiler.cpp', 'tgsi/invocation.hpp'),
31  include_directories : clover_incs,
32  cpp_args : [cpp_vis_args],
33)
34
35libclllvm = static_library(
36  'clllvm',
37  files(
38    'llvm/codegen/bitcode.cpp',
39    'llvm/codegen/common.cpp',
40    'llvm/codegen/native.cpp',
41    'llvm/codegen.hpp',
42    'llvm/compat.hpp',
43    'llvm/invocation.cpp',
44    'llvm/invocation.hpp',
45    'llvm/metadata.hpp',
46    'llvm/util.hpp',
47  ),
48  include_directories : clover_incs,
49  cpp_args : [
50    cpp_vis_args,
51    '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir')),
52    '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('libexecdir')),
53    '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
54      dep_llvm.get_configtool_variable('libdir'), 'clang',
55      dep_llvm.get_configtool_variable('version'), 'include',
56    )),
57  ],
58  dependencies : [dep_llvm, dep_elf],
59)
60
61clover_files = files(
62  'api/context.cpp',
63  'api/device.cpp',
64  'api/dispatch.cpp',
65  'api/dispatch.hpp',
66  'api/event.cpp',
67  'api/interop.cpp',
68  'api/kernel.cpp',
69  'api/memory.cpp',
70  'api/platform.cpp',
71  'api/program.cpp',
72  'api/queue.cpp',
73  'api/sampler.cpp',
74  'api/transfer.cpp',
75  'api/util.hpp',
76  'core/context.cpp',
77  'core/context.hpp',
78  'core/device.cpp',
79  'core/device.hpp',
80  'core/error.hpp',
81  'core/event.cpp',
82  'core/event.hpp',
83  'core/format.cpp',
84  'core/format.hpp',
85  'core/kernel.cpp',
86  'core/kernel.hpp',
87  'core/memory.cpp',
88  'core/memory.hpp',
89  'core/module.cpp',
90  'core/module.hpp',
91  'core/object.hpp',
92  'core/platform.cpp',
93  'core/platform.hpp',
94  'core/program.cpp',
95  'core/program.hpp',
96  'core/property.hpp',
97  'core/queue.cpp',
98  'core/queue.hpp',
99  'core/resource.cpp',
100  'core/resource.hpp',
101  'core/sampler.cpp',
102  'core/sampler.hpp',
103  'core/timestamp.cpp',
104  'core/timestamp.hpp',
105  'util/adaptor.hpp',
106  'util/algebra.hpp',
107  'util/algorithm.hpp',
108  'util/factor.hpp',
109  'util/functional.hpp',
110  'util/lazy.hpp',
111  'util/pointer.hpp',
112  'util/range.hpp',
113  'util/tuple.hpp',
114)
115
116libclover = static_library(
117  'clover',
118  clover_files,
119  include_directories : clover_incs,
120  cpp_args : [clover_cpp_args, cpp_vis_args],
121  link_with : [libcltgsi, libclllvm],
122)
123