Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/microsoft/clc/meson.build
4560 views
1
# Copyright © Microsoft Corporation
2
3
# Permission is hereby granted, free of charge, to any person obtaining a
4
# copy of this software and associated documentation files (the "Software"),
5
# to deal in the Software without restriction, including without limitation
6
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
# and/or sell copies of the Software, and to permit persons to whom the
8
# Software is furnished to do so, subject to the following conditions:
9
10
# The above copyright notice and this permission notice (including the next
11
# paragraph) shall be included in all copies or substantial portions of the
12
# Software.
13
14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20
# IN THE SOFTWARE.
21
22
clang_ver_dir = dep_clang.version()
23
if clang_ver_dir.endswith('git')
24
clang_ver_dir = clang_ver_dir.substring(0, -3)
25
endif
26
27
clang_resource_dir = join_paths(
28
dep_clang.get_variable(cmake: 'CLANG_INCLUDE_DIRS'), '..',
29
'lib', 'clang', clang_ver_dir, 'include'
30
)
31
32
opencl_c_h = custom_target(
33
'opencl-c.h',
34
input : [files_xxd, join_paths(clang_resource_dir, 'opencl-c.h')],
35
output : 'opencl-c.h.h',
36
command : [prog_python, '@INPUT@', '@OUTPUT@', '-n', 'opencl_c_source'],
37
)
38
opencl_c_base_h = custom_target(
39
'opencl-c-base.h',
40
input : [files_xxd, join_paths(clang_resource_dir, 'opencl-c-base.h')],
41
output : 'opencl-c-base.h.h',
42
command : [prog_python, '@INPUT@', '@OUTPUT@', '-n', 'opencl_c_base_source'],
43
)
44
45
files_libclc_compiler = files(
46
'clc_compiler.c',
47
'clc_nir.c',
48
'clc_helpers.cpp'
49
)
50
51
libclc_compiler = shared_library(
52
'clglon12compiler',
53
[files_libclc_compiler, sha1_h],
54
opencl_c_h,
55
opencl_c_base_h,
56
vs_module_defs : 'clglon12compiler.def',
57
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_compiler, inc_gallium, inc_spirv],
58
dependencies: [idep_nir_headers, dep_clang, dep_llvm, cc.find_library('version'),
59
dep_llvmspirvlib, idep_mesautil, idep_libdxil_compiler, idep_nir, dep_spirv_tools]
60
)
61
62
if dep_dxheaders.found()
63
clc_compiler_test = executable('clc_compiler_test',
64
['clc_compiler_test.cpp', 'compute_test.cpp'],
65
link_with : [libclc_compiler],
66
dependencies : [idep_gtest, idep_mesautil, idep_libdxil_compiler, dep_dxheaders],
67
include_directories : [inc_include, inc_src])
68
69
test('clc_compiler_test', clc_compiler_test, timeout: 180)
70
endif
71
72