Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/gallium/frontends/clover/meson.build
4565 views
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=300',
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
'-DCL_USE_DEPRECATED_OPENCL_2_2_APIS',
30
'-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'includedir')),
31
'-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'libexecdir'))
32
]
33
clover_spirv_cpp_args = []
34
clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
35
36
# the CL header files declare attributes on the CL types. Compilers warn if
37
# we use them as template arguments. Disable the warning as there isn't
38
# anything we can do about it
39
if cpp.has_argument('-Wno-ignored-attributes')
40
clover_cpp_args += '-Wno-ignored-attributes'
41
endif
42
43
if with_opencl_icd
44
clover_cpp_args += '-DHAVE_CLOVER_ICD'
45
endif
46
47
if with_opencl_native
48
clover_spirv_cpp_args += '-DHAVE_CLOVER_NATIVE'
49
endif
50
51
if with_opencl_spirv
52
clover_spirv_cpp_args += '-DHAVE_CLOVER_SPIRV'
53
endif
54
55
libclllvm = static_library(
56
'clllvm',
57
files(
58
'llvm/codegen/bitcode.cpp',
59
'llvm/codegen/common.cpp',
60
'llvm/codegen/native.cpp',
61
'llvm/codegen.hpp',
62
'llvm/compat.hpp',
63
'llvm/invocation.cpp',
64
'llvm/invocation.hpp',
65
'llvm/metadata.hpp',
66
'llvm/util.hpp',
67
),
68
include_directories : clover_incs,
69
cpp_args : [
70
clover_cpp_args,
71
clover_opencl_cpp_args,
72
clover_spirv_cpp_args,
73
'-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
74
dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
75
dep_llvm.version(), 'include',
76
)),
77
],
78
gnu_symbol_visibility : 'hidden',
79
dependencies : [dep_llvm, dep_elf, dep_llvmspirvlib, idep_mesautil],
80
)
81
82
libclspirv = static_library(
83
'clspirv',
84
files('spirv/invocation.cpp', 'spirv/invocation.hpp'),
85
include_directories : clover_incs,
86
cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args],
87
gnu_symbol_visibility : 'hidden',
88
dependencies : [dep_spirv_tools, idep_mesautil],
89
)
90
91
libclnir = static_library(
92
'clnir',
93
files('nir/invocation.cpp', 'nir/invocation.hpp'),
94
include_directories : [clover_incs, inc_mesa],
95
dependencies : idep_nir,
96
cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args],
97
gnu_symbol_visibility : 'hidden',
98
)
99
100
clover_files = files(
101
'api/context.cpp',
102
'api/device.cpp',
103
'api/dispatch.cpp',
104
'api/dispatch.hpp',
105
'api/event.cpp',
106
'api/interop.cpp',
107
'api/invalid.cpp',
108
'api/kernel.cpp',
109
'api/memory.cpp',
110
'api/platform.cpp',
111
'api/program.cpp',
112
'api/queue.cpp',
113
'api/sampler.cpp',
114
'api/transfer.cpp',
115
'api/util.hpp',
116
'core/compiler.hpp',
117
'core/context.cpp',
118
'core/context.hpp',
119
'core/device.cpp',
120
'core/device.hpp',
121
'core/error.hpp',
122
'core/event.cpp',
123
'core/event.hpp',
124
'core/format.cpp',
125
'core/format.hpp',
126
'core/kernel.cpp',
127
'core/kernel.hpp',
128
'core/memory.cpp',
129
'core/memory.hpp',
130
'core/module.cpp',
131
'core/module.hpp',
132
'core/object.hpp',
133
'core/platform.cpp',
134
'core/platform.hpp',
135
'core/printf.cpp',
136
'core/printf.hpp',
137
'core/program.cpp',
138
'core/program.hpp',
139
'core/property.hpp',
140
'core/queue.cpp',
141
'core/queue.hpp',
142
'core/resource.cpp',
143
'core/resource.hpp',
144
'core/sampler.cpp',
145
'core/sampler.hpp',
146
'core/timestamp.cpp',
147
'core/timestamp.hpp',
148
'util/adaptor.hpp',
149
'util/algebra.hpp',
150
'util/algorithm.hpp',
151
'util/factor.hpp',
152
'util/functional.hpp',
153
'util/lazy.hpp',
154
'util/pointer.hpp',
155
'util/range.hpp',
156
'util/tuple.hpp',
157
)
158
159
libclover = static_library(
160
'clover',
161
[clover_files, sha1_h],
162
include_directories : clover_incs,
163
cpp_args : [
164
clover_opencl_cpp_args,
165
clover_spirv_cpp_args,
166
clover_cpp_args,
167
],
168
gnu_symbol_visibility : 'hidden',
169
link_with : [libclllvm, libclspirv, libclnir],
170
dependencies : idep_mesautil,
171
)
172
173