• 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]
49
50vk_entrypoints_gen = files('vk_entrypoints_gen.py')
51vk_extensions_gen = files('vk_extensions_gen.py')
52vk_icd_gen = files('vk_icd_gen.py')
53vk_cmd_queue_gen = files('vk_cmd_queue_gen.py')
54vk_dispatch_trampolines_gen = files('vk_dispatch_trampolines_gen.py')
55
56files_vulkan_util = files(
57  'vk_alloc.c',
58  'vk_alloc.h',
59  'vk_format.c',
60  'vk_util.c',
61  'vk_util.h',
62)
63
64vk_dispatch_table = custom_target(
65  'vk_dispatch_table',
66  input : ['vk_dispatch_table_gen.py', vk_api_xml],
67  output : ['vk_dispatch_table.c', 'vk_dispatch_table.h'],
68  command : [
69    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
70    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
71  ],
72  depend_files : vk_dispatch_table_gen_depend_files,
73)
74
75vk_enum_to_str = custom_target(
76  'vk_enum_to_str',
77  input : ['gen_enum_to_str.py', vk_api_xml],
78  output : ['vk_enum_to_str.c', 'vk_enum_to_str.h', 'vk_enum_defines.h'],
79  command : [
80    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
81    '--outdir', meson.current_build_dir()
82  ],
83)
84
85vk_extensions = custom_target(
86  'vk_extensions',
87  input : ['vk_extensions_gen.py', vk_api_xml],
88  output : ['vk_extensions.c', 'vk_extensions.h'],
89  command : [
90    prog_python, '@INPUT0@', '--xml', '@INPUT1@',
91    '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
92  ],
93  depend_files : vk_extensions_gen_depend_files,
94)
95
96libvulkan_util = static_library(
97  'vulkan_util',
98  [files_vulkan_util, vk_dispatch_table, vk_enum_to_str, vk_extensions],
99  include_directories : [inc_include, inc_src, inc_gallium],
100  dependencies : [vulkan_wsi_deps, idep_mesautil, idep_nir_headers],
101  c_args : [c_msvc_compat_args],
102  gnu_symbol_visibility : 'hidden',
103  build_by_default : false,
104)
105
106idep_vulkan_util_headers = declare_dependency(
107  sources : [vk_dispatch_table[1], vk_enum_to_str[1], vk_extensions[1]],
108  include_directories : include_directories('.')
109)
110
111idep_vulkan_util = declare_dependency(
112  link_with : libvulkan_util,
113  dependencies : idep_vulkan_util_headers
114)
115