Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/vulkan/util/meson.build
7130 views
1
# Copyright © 2017 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
# Mesa-local imports in the Python files must be declared here for correct
22
# dependency tracking.
23
vk_extensions_depend_files = [
24
]
25
vk_extensions_gen_depend_files = [
26
files('vk_extensions.py'),
27
vk_extensions_depend_files,
28
]
29
vk_dispatch_table_gen_depend_files = [
30
files('vk_extensions.py'),
31
vk_extensions_depend_files,
32
]
33
vk_entrypoints_gen_depend_files = [
34
files('vk_dispatch_table_gen.py'),
35
vk_dispatch_table_gen_depend_files,
36
]
37
38
vk_entrypoints_gen = files('vk_entrypoints_gen.py')
39
vk_extensions_gen = files('vk_extensions_gen.py')
40
vk_icd_gen = files('vk_icd_gen.py')
41
42
files_vulkan_util = files(
43
'vk_alloc.c',
44
'vk_alloc.h',
45
'vk_cmd_copy.c',
46
'vk_debug_report.c',
47
'vk_debug_report.h',
48
'vk_deferred_operation.c',
49
'vk_deferred_operation.h',
50
'vk_descriptors.c',
51
'vk_descriptors.h',
52
'vk_device.c',
53
'vk_device.h',
54
'vk_format.c',
55
'vk_instance.c',
56
'vk_instance.h',
57
'vk_object.c',
58
'vk_object.h',
59
'vk_physical_device.c',
60
'vk_physical_device.h',
61
'vk_render_pass.c',
62
'vk_shader_module.c',
63
'vk_shader_module.h',
64
'vk_util.c',
65
'vk_util.h',
66
)
67
68
vk_common_entrypoints = custom_target(
69
'vk_common_entrypoints',
70
input : [vk_entrypoints_gen, vk_api_xml],
71
output : ['vk_common_entrypoints.h', 'vk_common_entrypoints.c'],
72
command : [
73
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
74
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vk_common',
75
],
76
depend_files : vk_entrypoints_gen_depend_files,
77
)
78
79
vk_dispatch_table = custom_target(
80
'vk_dispatch_table',
81
input : ['vk_dispatch_table_gen.py', vk_api_xml],
82
output : ['vk_dispatch_table.c', 'vk_dispatch_table.h'],
83
command : [
84
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
85
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
86
],
87
depend_files : vk_dispatch_table_gen_depend_files,
88
)
89
90
vk_enum_to_str = custom_target(
91
'vk_enum_to_str',
92
input : ['gen_enum_to_str.py', vk_api_xml],
93
output : ['vk_enum_to_str.c', 'vk_enum_to_str.h'],
94
command : [
95
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
96
'--outdir', meson.current_build_dir()
97
],
98
)
99
100
vk_extensions = custom_target(
101
'vk_extensions',
102
input : ['vk_extensions_gen.py', vk_api_xml],
103
output : ['vk_extensions.c', 'vk_extensions.h'],
104
command : [
105
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
106
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
107
],
108
depend_files : vk_extensions_gen_depend_files,
109
)
110
111
libvulkan_util = static_library(
112
'vulkan_util',
113
[files_vulkan_util, vk_common_entrypoints, vk_dispatch_table,
114
vk_enum_to_str, vk_extensions],
115
include_directories : [inc_include, inc_src, inc_gallium],
116
dependencies : [vulkan_wsi_deps, idep_mesautil],
117
# For glsl_type_singleton
118
link_with : libcompiler,
119
c_args : [vulkan_wsi_args],
120
gnu_symbol_visibility : 'hidden',
121
build_by_default : false,
122
)
123
124
idep_vulkan_util_headers = declare_dependency(
125
sources : [vk_dispatch_table[1], vk_enum_to_str[1], vk_extensions[1]],
126
include_directories : include_directories('.')
127
)
128
129
# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
130
# See this discussion here:
131
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
132
if get_option('backend').startswith('vs')
133
idep_vulkan_util = declare_dependency(
134
link_with : libvulkan_util,
135
dependencies : idep_vulkan_util_headers
136
)
137
else
138
idep_vulkan_util = declare_dependency(
139
# Instruct users of this library to link with --whole-archive. Otherwise,
140
# our weak function overloads may not resolve properly.
141
link_whole : libvulkan_util,
142
dependencies : idep_vulkan_util_headers
143
)
144
endif
145
146