Path: blob/21.2-virgl/src/vulkan/util/meson.build
7130 views
# Copyright © 2017 Intel Corporation12# Permission is hereby granted, free of charge, to any person obtaining a copy3# of this software and associated documentation files (the "Software"), to deal4# in the Software without restriction, including without limitation the rights5# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell6# copies of the Software, and to permit persons to whom the Software is7# furnished to do so, subject to the following conditions:89# The above copyright notice and this permission notice shall be included in10# all copies or substantial portions of the Software.1112# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE15# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,17# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE18# SOFTWARE.1920# Mesa-local imports in the Python files must be declared here for correct21# dependency tracking.22vk_extensions_depend_files = [23]24vk_extensions_gen_depend_files = [25files('vk_extensions.py'),26vk_extensions_depend_files,27]28vk_dispatch_table_gen_depend_files = [29files('vk_extensions.py'),30vk_extensions_depend_files,31]32vk_entrypoints_gen_depend_files = [33files('vk_dispatch_table_gen.py'),34vk_dispatch_table_gen_depend_files,35]3637vk_entrypoints_gen = files('vk_entrypoints_gen.py')38vk_extensions_gen = files('vk_extensions_gen.py')39vk_icd_gen = files('vk_icd_gen.py')4041files_vulkan_util = files(42'vk_alloc.c',43'vk_alloc.h',44'vk_cmd_copy.c',45'vk_debug_report.c',46'vk_debug_report.h',47'vk_deferred_operation.c',48'vk_deferred_operation.h',49'vk_descriptors.c',50'vk_descriptors.h',51'vk_device.c',52'vk_device.h',53'vk_format.c',54'vk_instance.c',55'vk_instance.h',56'vk_object.c',57'vk_object.h',58'vk_physical_device.c',59'vk_physical_device.h',60'vk_render_pass.c',61'vk_shader_module.c',62'vk_shader_module.h',63'vk_util.c',64'vk_util.h',65)6667vk_common_entrypoints = custom_target(68'vk_common_entrypoints',69input : [vk_entrypoints_gen, vk_api_xml],70output : ['vk_common_entrypoints.h', 'vk_common_entrypoints.c'],71command : [72prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',73'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vk_common',74],75depend_files : vk_entrypoints_gen_depend_files,76)7778vk_dispatch_table = custom_target(79'vk_dispatch_table',80input : ['vk_dispatch_table_gen.py', vk_api_xml],81output : ['vk_dispatch_table.c', 'vk_dispatch_table.h'],82command : [83prog_python, '@INPUT0@', '--xml', '@INPUT1@',84'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'85],86depend_files : vk_dispatch_table_gen_depend_files,87)8889vk_enum_to_str = custom_target(90'vk_enum_to_str',91input : ['gen_enum_to_str.py', vk_api_xml],92output : ['vk_enum_to_str.c', 'vk_enum_to_str.h'],93command : [94prog_python, '@INPUT0@', '--xml', '@INPUT1@',95'--outdir', meson.current_build_dir()96],97)9899vk_extensions = custom_target(100'vk_extensions',101input : ['vk_extensions_gen.py', vk_api_xml],102output : ['vk_extensions.c', 'vk_extensions.h'],103command : [104prog_python, '@INPUT0@', '--xml', '@INPUT1@',105'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'106],107depend_files : vk_extensions_gen_depend_files,108)109110libvulkan_util = static_library(111'vulkan_util',112[files_vulkan_util, vk_common_entrypoints, vk_dispatch_table,113vk_enum_to_str, vk_extensions],114include_directories : [inc_include, inc_src, inc_gallium],115dependencies : [vulkan_wsi_deps, idep_mesautil],116# For glsl_type_singleton117link_with : libcompiler,118c_args : [vulkan_wsi_args],119gnu_symbol_visibility : 'hidden',120build_by_default : false,121)122123idep_vulkan_util_headers = declare_dependency(124sources : [vk_dispatch_table[1], vk_enum_to_str[1], vk_extensions[1]],125include_directories : include_directories('.')126)127128# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.129# See this discussion here:130# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506131if get_option('backend').startswith('vs')132idep_vulkan_util = declare_dependency(133link_with : libvulkan_util,134dependencies : idep_vulkan_util_headers135)136else137idep_vulkan_util = declare_dependency(138# Instruct users of this library to link with --whole-archive. Otherwise,139# our weak function overloads may not resolve properly.140link_whole : libvulkan_util,141dependencies : idep_vulkan_util_headers142)143endif144145146