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] 55vk_synchronization_helpers_gen_depend_files = [ 56 files('vk_extensions.py'), 57] 58vk_enum_to_str_depend_files = [ 59 files('vk_extensions.py'), 60] 61vk_struct_type_cast_depend_files = [ 62 files('vk_extensions.py'), 63] 64 65vk_entrypoints_gen = files('vk_entrypoints_gen.py') 66vk_extensions_gen = files('vk_extensions_gen.py') 67vk_icd_gen = files('vk_icd_gen.py') 68vk_cmd_queue_gen = files('vk_cmd_queue_gen.py') 69vk_dispatch_trampolines_gen = files('vk_dispatch_trampolines_gen.py') 70vk_physical_device_features_gen = files('vk_physical_device_features_gen.py') 71vk_physical_device_properties_gen = files('vk_physical_device_properties_gen.py') 72vk_synchronization_helpers_gen = files('vk_synchronization_helpers_gen.py') 73 74files_vulkan_util = files( 75 'vk_alloc.c', 76 'vk_alloc.h', 77 'vk_format.c', 78 'vk_util.c', 79 'vk_util.h', 80) 81 82files_vulkan_util_compiler = files( 83 'vk_util_compiler.c', 84 'vk_util_compiler.h', 85) 86 87vk_dispatch_table = custom_target( 88 'vk_dispatch_table', 89 input : ['vk_dispatch_table_gen.py', vk_api_xml], 90 output : ['vk_dispatch_table.c', 'vk_dispatch_table.h'], 91 command : [ 92 prog_python, '@INPUT0@', '--xml', '@INPUT1@', 93 '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@', 94 '--beta', with_vulkan_beta.to_string() 95 ], 96 depend_files : vk_dispatch_table_gen_depend_files, 97) 98 99vk_enum_to_str = custom_target( 100 'vk_enum_to_str', 101 input : ['gen_enum_to_str.py', vk_api_xml], 102 output : ['vk_enum_to_str.c', 'vk_enum_to_str.h', 'vk_enum_defines.h'], 103 command : [ 104 prog_python, '@INPUT0@', '--xml', '@INPUT1@', 105 '--outdir', meson.current_build_dir(), 106 '--beta', with_vulkan_beta.to_string() 107 ], 108 depend_files : vk_enum_to_str_depend_files, 109) 110 111vk_struct_type_cast = custom_target( 112 'vk_struct_type_cast', 113 input : ['vk_struct_type_cast_gen.py', vk_api_xml], 114 output : ['vk_struct_type_cast.h'], 115 command : [ 116 prog_python, '@INPUT0@', '--xml', '@INPUT1@', 117 '--outdir', meson.current_build_dir(), 118 '--beta', with_vulkan_beta.to_string() 119 ], 120 depend_files : vk_enum_to_str_depend_files, 121) 122 123vk_extensions = custom_target( 124 'vk_extensions', 125 input : ['vk_extensions_gen.py', vk_api_xml], 126 output : ['vk_extensions.c', 'vk_extensions.h'], 127 command : [ 128 prog_python, '@INPUT0@', '--xml', '@INPUT1@', 129 '--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@' 130 ], 131 depend_files : vk_extensions_gen_depend_files, 132) 133 134vulkan_util_deps = [vulkan_wsi_deps, idep_mesautil] 135if with_vk_compiler 136 files_vulkan_util += files_vulkan_util_compiler 137 vulkan_util_deps += [idep_nir_headers] 138endif 139 140libvulkan_util = static_library( 141 'vulkan_util', 142 [files_vulkan_util, vk_dispatch_table, vk_enum_to_str, 143 vk_struct_type_cast, vk_extensions], 144 include_directories : [inc_include, inc_src], 145 dependencies : [vulkan_util_deps], 146 c_args : [c_msvc_compat_args], 147 gnu_symbol_visibility : 'hidden', 148 build_by_default : false, 149) 150 151idep_vulkan_util_headers = declare_dependency( 152 sources : [vk_dispatch_table[1], vk_enum_to_str[1], 153 vk_struct_type_cast[0], vk_extensions[1]], 154 include_directories : include_directories('.') 155) 156 157idep_vulkan_util = declare_dependency( 158 link_with : libvulkan_util, 159 dependencies : idep_vulkan_util_headers 160) 161