meson.build revision 361fc4cb
1361fc4cbSmaya# Copyright © 2017 Intel Corporation 2361fc4cbSmaya 3361fc4cbSmaya# Permission is hereby granted, free of charge, to any person obtaining a copy 4361fc4cbSmaya# of this software and associated documentation files (the "Software"), to deal 5361fc4cbSmaya# in the Software without restriction, including without limitation the rights 6361fc4cbSmaya# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7361fc4cbSmaya# copies of the Software, and to permit persons to whom the Software is 8361fc4cbSmaya# furnished to do so, subject to the following conditions: 9361fc4cbSmaya 10361fc4cbSmaya# The above copyright notice and this permission notice shall be included in 11361fc4cbSmaya# all copies or substantial portions of the Software. 12361fc4cbSmaya 13361fc4cbSmaya# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14361fc4cbSmaya# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15361fc4cbSmaya# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16361fc4cbSmaya# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17361fc4cbSmaya# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18361fc4cbSmaya# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19361fc4cbSmaya# SOFTWARE. 20361fc4cbSmaya 21361fc4cbSmayatu_entrypoints = custom_target( 22361fc4cbSmaya 'tu_entrypoints.[ch]', 23361fc4cbSmaya input : ['tu_entrypoints_gen.py', vk_api_xml], 24361fc4cbSmaya output : ['tu_entrypoints.h', 'tu_entrypoints.c'], 25361fc4cbSmaya command : [ 26361fc4cbSmaya prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir', 27361fc4cbSmaya meson.current_build_dir() 28361fc4cbSmaya ], 29361fc4cbSmaya depend_files : files('tu_extensions.py'), 30361fc4cbSmaya) 31361fc4cbSmaya 32361fc4cbSmayatu_extensions_c = custom_target( 33361fc4cbSmaya 'tu_extensions.c', 34361fc4cbSmaya input : ['tu_extensions.py', vk_api_xml], 35361fc4cbSmaya output : ['tu_extensions.c', 'tu_extensions.h'], 36361fc4cbSmaya command : [ 37361fc4cbSmaya prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@', 38361fc4cbSmaya '--out-h', '@OUTPUT1@' 39361fc4cbSmaya ], 40361fc4cbSmaya) 41361fc4cbSmaya 42361fc4cbSmayatu_format_table_c = custom_target( 43361fc4cbSmaya 'tu_format_table.c', 44361fc4cbSmaya input : ['vk_format_table.py', 'vk_format_layout.csv'], 45361fc4cbSmaya output : 'vk_format_table.c', 46361fc4cbSmaya command : [prog_python, '@INPUT@'], 47361fc4cbSmaya depend_files : files('vk_format_parse.py'), 48361fc4cbSmaya capture : true, 49361fc4cbSmaya) 50361fc4cbSmaya 51361fc4cbSmayalibtu_files = files( 52361fc4cbSmaya 'tu_cmd_buffer.c', 53361fc4cbSmaya 'tu_cs.c', 54361fc4cbSmaya 'tu_device.c', 55361fc4cbSmaya 'tu_descriptor_set.c', 56361fc4cbSmaya 'tu_descriptor_set.h', 57361fc4cbSmaya 'tu_drm.c', 58361fc4cbSmaya 'tu_fence.c', 59361fc4cbSmaya 'tu_formats.c', 60361fc4cbSmaya 'tu_image.c', 61361fc4cbSmaya 'tu_meta_blit.c', 62361fc4cbSmaya 'tu_meta_buffer.c', 63361fc4cbSmaya 'tu_meta_clear.c', 64361fc4cbSmaya 'tu_meta_copy.c', 65361fc4cbSmaya 'tu_meta_resolve.c', 66361fc4cbSmaya 'tu_pass.c', 67361fc4cbSmaya 'tu_pipeline.c', 68361fc4cbSmaya 'tu_pipeline_cache.c', 69361fc4cbSmaya 'tu_private.h', 70361fc4cbSmaya 'tu_query.c', 71361fc4cbSmaya 'tu_shader.c', 72361fc4cbSmaya 'tu_util.c', 73361fc4cbSmaya 'tu_util.h', 74361fc4cbSmaya 'tu_wsi.c', 75361fc4cbSmaya 'vk_format.h', 76361fc4cbSmaya) 77361fc4cbSmaya 78361fc4cbSmayatu_deps = [] 79361fc4cbSmayatu_flags = [] 80361fc4cbSmaya 81361fc4cbSmayaif with_platform_wayland 82361fc4cbSmaya tu_deps += dep_wayland_client 83361fc4cbSmaya tu_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR' 84361fc4cbSmaya libtu_files += files('tu_wsi_wayland.c') 85361fc4cbSmayaendif 86361fc4cbSmaya 87361fc4cbSmayalibvulkan_freedreno = shared_library( 88361fc4cbSmaya 'vulkan_freedreno', 89361fc4cbSmaya [libtu_files, tu_entrypoints, tu_extensions_c, tu_format_table_c], 90361fc4cbSmaya include_directories : [ 91361fc4cbSmaya inc_common, 92361fc4cbSmaya inc_compiler, 93361fc4cbSmaya inc_vulkan_wsi, 94361fc4cbSmaya inc_freedreno, 95361fc4cbSmaya ], 96361fc4cbSmaya link_with : [ 97361fc4cbSmaya libvulkan_wsi, 98361fc4cbSmaya libmesa_util, 99361fc4cbSmaya libfreedreno_drm, # required by ir3_shader_get_variant, which we don't use 100361fc4cbSmaya libfreedreno_ir3, 101361fc4cbSmaya ], 102361fc4cbSmaya dependencies : [ 103361fc4cbSmaya dep_dl, 104361fc4cbSmaya dep_elf, 105361fc4cbSmaya dep_libdrm, 106361fc4cbSmaya dep_llvm, 107361fc4cbSmaya dep_m, 108361fc4cbSmaya dep_thread, 109361fc4cbSmaya dep_valgrind, 110361fc4cbSmaya idep_nir, 111361fc4cbSmaya tu_deps, 112361fc4cbSmaya idep_vulkan_util, 113361fc4cbSmaya ], 114361fc4cbSmaya c_args : [c_vis_args, no_override_init_args, tu_flags], 115361fc4cbSmaya link_args : [ld_args_bsymbolic, ld_args_gc_sections], 116361fc4cbSmaya install : true, 117361fc4cbSmaya) 118361fc4cbSmaya 119361fc4cbSmayafreedreno_icd = custom_target( 120361fc4cbSmaya 'freedreno_icd', 121361fc4cbSmaya input : 'tu_icd.py', 122361fc4cbSmaya output : 'freedreno_icd.@0@.json'.format(host_machine.cpu()), 123361fc4cbSmaya command : [ 124361fc4cbSmaya prog_python, '@INPUT@', 125361fc4cbSmaya '--lib-path', join_paths(get_option('prefix'), get_option('libdir')), 126361fc4cbSmaya '--out', '@OUTPUT@', 127361fc4cbSmaya ], 128361fc4cbSmaya depend_files : files('tu_extensions.py'), 129361fc4cbSmaya build_by_default : true, 130361fc4cbSmaya install_dir : with_vulkan_icd_dir, 131361fc4cbSmaya install : true, 132361fc4cbSmaya) 133361fc4cbSmaya 134361fc4cbSmayatu_dev_icd = custom_target( 135361fc4cbSmaya 'tu_dev_icd', 136361fc4cbSmaya input : 'tu_icd.py', 137361fc4cbSmaya output : 'dev_icd.json', 138361fc4cbSmaya command : [ 139361fc4cbSmaya prog_python, '@INPUT@', '--lib-path', meson.current_build_dir(), 140361fc4cbSmaya '--out', '@OUTPUT@' 141361fc4cbSmaya ], 142361fc4cbSmaya depend_files : files('tu_extensions.py'), 143361fc4cbSmaya build_by_default : true, 144361fc4cbSmaya install : false, 145361fc4cbSmaya) 146