• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
23vk_extensions_depend_files = [
24]
25vk_entrypoints_depend_files = [
26  files('vk_extensions.py'),
27  vk_extensions_depend_files,
28]
29vk_extensions_gen_depend_files = [
30  files('vk_extensions.py'),
31  vk_extensions_depend_files,
32]
33vk_dispatch_table_gen_depend_files = [
34  files('vk_entrypoints.py'),
35  vk_entrypoints_depend_files,
36]
37vk_dispatch_trampolines_gen_depend_files = [
38  files('vk_entrypoints.py'),
39  vk_entrypoints_depend_files,
40]
41vk_entrypoints_gen_depend_files = [
42  files('vk_entrypoints.py'),
43  vk_entrypoints_depend_files,
44]
45vk_cmd_queue_gen_depend_files = [
46  files('vk_entrypoints.py'),
47  vk_entrypoints_depend_files,
48]
49vk_physical_device_features_gen_depend_files = [
50  files('vk_extensions.py'),
51]
52vk_physical_device_properties_gen_depend_files = [
53  files('vk_extensions.py'),
54]
55
56vk_entrypoints_gen = files('vk_entrypoints_gen.py')
57vk_extensions_gen = files('vk_extensions_gen.py')
58vk_icd_gen = files('vk_icd_gen.py')
59vk_cmd_queue_gen = files('vk_cmd_queue_gen.py')
60vk_dispatch_trampolines_gen = files('vk_dispatch_trampolines_gen.py')
61vk_physical_device_features_gen = files('vk_physical_device_features_gen.py')
62vk_physical_device_properties_gen = files('vk_physical_device_properties_gen.py')
63
64files_vulkan_util = files(
65  'vk_alloc.c',
66  'vk_alloc.h',
67  'vk_format.c',
68  'vk_util.c',
69  'vk_util.h',
70)
71
72vk_dispatch_table = custom_target(
73  'vk_dispatch_table',
74  input : ['vk_dispatch_table_gen.py', vk_api_xml],
75  output : ['vk_dispatch_table.c', 'vk_dispatch_table.h'],
76  command : [
77    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
78    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@',
79    '--beta', with_vulkan_beta.to_string()
80  ],
81  depend_files : vk_dispatch_table_gen_depend_files,
82)
83
84vk_enum_to_str = custom_target(
85  'vk_enum_to_str',
86  input : ['gen_enum_to_str.py', vk_api_xml],
87  output : ['vk_enum_to_str.c', 'vk_enum_to_str.h', 'vk_enum_defines.h'],
88  command : [
89    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
90    '--outdir', meson.current_build_dir(),
91    '--beta', with_vulkan_beta.to_string()
92  ],
93)
94
95vk_struct_type_cast = custom_target(
96  'vk_struct_type_cast',
97  input : ['vk_struct_type_cast_gen.py', vk_api_xml],
98  output : ['vk_struct_type_cast.h'],
99  command : [
100    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
101    '--outdir', meson.current_build_dir(),
102    '--beta', with_vulkan_beta.to_string()
103  ],
104)
105
106vk_extensions = custom_target(
107  'vk_extensions',
108  input : ['vk_extensions_gen.py', vk_api_xml],
109  output : ['vk_extensions.c', 'vk_extensions.h'],
110  command : [
111    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
112    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
113  ],
114  depend_files : vk_extensions_gen_depend_files,
115)
116
117inc_vulkan_util = [inc_include, inc_src]
118vulkan_util_deps = [vulkan_wsi_deps, idep_mesautil]
119vulkan_util_args = []
120if with_vk_no_nir
121  vulkan_util_args += '-DVK_NO_NIR'
122else
123  vulkan_util_deps += [idep_nir_headers]
124  inc_vulkan_util += inc_gallium
125endif
126
127libvulkan_util = static_library(
128  'vulkan_util',
129  [files_vulkan_util, vk_dispatch_table, vk_enum_to_str,
130   vk_struct_type_cast, vk_extensions],
131  include_directories : [inc_vulkan_util],
132  dependencies : [vulkan_util_deps],
133  c_args : [c_msvc_compat_args, vulkan_util_args],
134  gnu_symbol_visibility : 'hidden',
135  build_by_default : false,
136)
137
138idep_vulkan_util_headers = declare_dependency(
139  sources : [vk_dispatch_table[1], vk_enum_to_str[1],
140             vk_struct_type_cast[0], vk_extensions[1]],
141  include_directories : include_directories('.')
142)
143
144idep_vulkan_util = declare_dependency(
145  link_with : libvulkan_util,
146  dependencies : idep_vulkan_util_headers
147)
148