gallium: rename 'state tracker' to 'frontend'
[mesa.git] / src / gallium / frontends / clover / meson.build
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
21 clover_cpp_args = []
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'
29 ]
30 clover_spirv_cpp_args = []
31 clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
32
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'
38 endif
39
40 if with_opencl_icd
41 clover_cpp_args += '-DHAVE_CLOVER_ICD'
42 endif
43
44 if with_opencl_spirv
45 clover_spirv_cpp_args += '-DHAVE_CLOVER_SPIRV'
46 endif
47
48 libclllvm = static_library(
49 'clllvm',
50 files(
51 'llvm/codegen/bitcode.cpp',
52 'llvm/codegen/common.cpp',
53 'llvm/codegen/native.cpp',
54 'llvm/codegen.hpp',
55 'llvm/compat.hpp',
56 'llvm/invocation.cpp',
57 'llvm/invocation.hpp',
58 'llvm/metadata.hpp',
59 'llvm/util.hpp',
60 ),
61 include_directories : clover_incs,
62 cpp_args : [
63 clover_cpp_args,
64 clover_opencl_cpp_args,
65 clover_spirv_cpp_args,
66 cpp_vis_args,
67 '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir')),
68 '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('libexecdir')),
69 '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
70 dep_llvm.get_configtool_variable('libdir'), 'clang',
71 dep_llvm.version(), 'include',
72 )),
73 ],
74 dependencies : [dep_llvm, dep_elf, dep_llvmspirvlib],
75 override_options : clover_cpp_std,
76 )
77
78 libclspirv = static_library(
79 'clspirv',
80 files('spirv/invocation.cpp', 'spirv/invocation.hpp'),
81 include_directories : clover_incs,
82 cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args, cpp_vis_args],
83 dependencies : [dep_spirv_tools],
84 override_options : clover_cpp_std,
85 )
86
87 libclnir = static_library(
88 'clnir',
89 files('nir/invocation.cpp', 'nir/invocation.hpp'),
90 include_directories : [clover_incs, inc_mesa],
91 dependencies : idep_nir,
92 cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args, cpp_vis_args],
93 override_options : clover_cpp_std,
94 )
95
96 clover_files = files(
97 'api/context.cpp',
98 'api/device.cpp',
99 'api/dispatch.cpp',
100 'api/dispatch.hpp',
101 'api/event.cpp',
102 'api/interop.cpp',
103 'api/kernel.cpp',
104 'api/memory.cpp',
105 'api/platform.cpp',
106 'api/program.cpp',
107 'api/queue.cpp',
108 'api/sampler.cpp',
109 'api/transfer.cpp',
110 'api/util.hpp',
111 'core/compiler.hpp',
112 'core/context.cpp',
113 'core/context.hpp',
114 'core/device.cpp',
115 'core/device.hpp',
116 'core/error.hpp',
117 'core/event.cpp',
118 'core/event.hpp',
119 'core/format.cpp',
120 'core/format.hpp',
121 'core/kernel.cpp',
122 'core/kernel.hpp',
123 'core/memory.cpp',
124 'core/memory.hpp',
125 'core/module.cpp',
126 'core/module.hpp',
127 'core/object.hpp',
128 'core/platform.cpp',
129 'core/platform.hpp',
130 'core/program.cpp',
131 'core/program.hpp',
132 'core/property.hpp',
133 'core/queue.cpp',
134 'core/queue.hpp',
135 'core/resource.cpp',
136 'core/resource.hpp',
137 'core/sampler.cpp',
138 'core/sampler.hpp',
139 'core/timestamp.cpp',
140 'core/timestamp.hpp',
141 'util/adaptor.hpp',
142 'util/algebra.hpp',
143 'util/algorithm.hpp',
144 'util/factor.hpp',
145 'util/functional.hpp',
146 'util/lazy.hpp',
147 'util/pointer.hpp',
148 'util/range.hpp',
149 'util/tuple.hpp',
150 )
151
152 libclover = static_library(
153 'clover',
154 [clover_files, sha1_h],
155 include_directories : clover_incs,
156 cpp_args : [
157 clover_opencl_cpp_args,
158 clover_spirv_cpp_args,
159 clover_cpp_args,
160 cpp_vis_args
161 ],
162 link_with : [libclllvm, libclspirv, libclnir],
163 override_options : clover_cpp_std,
164 )