Path: blob/21.2-virgl/src/intel/vulkan/meson.build
4547 views
# Copyright © 2017-2019 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.1920anv_entrypoints = custom_target(21'anv_entrypoints',22input : [vk_entrypoints_gen, vk_api_xml],23output : ['anv_entrypoints.h', 'anv_entrypoints.c'],24command : [25prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',26'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'anv',27'--device-prefix', 'gfx7', '--device-prefix', 'gfx75',28'--device-prefix', 'gfx8', '--device-prefix', 'gfx9',29'--device-prefix', 'gfx11', '--device-prefix', 'gfx12',30'--device-prefix', 'gfx125',31],32depend_files : vk_entrypoints_gen_depend_files,33)3435intel_icd = custom_target(36'intel_icd',37input : [vk_icd_gen, vk_api_xml],38output : 'intel_icd.@[email protected]'.format(host_machine.cpu()),39command : [40prog_python, '@INPUT0@',41'--api-version', '1.2', '--xml', '@INPUT1@',42'--lib-path', join_paths(get_option('prefix'), get_option('libdir'),43'libvulkan_intel.so'),44'--out', '@OUTPUT@',45],46build_by_default : true,47install_dir : with_vulkan_icd_dir,48install : true,49)5051libanv_per_hw_ver_libs = []52anv_per_hw_ver_files = files(53'genX_blorp_exec.c',54'genX_cmd_buffer.c',55'genX_gpu_memcpy.c',56'genX_pipeline.c',57'genX_query.c',58'genX_state.c',59)60foreach g : [['70', ['gfx7_cmd_buffer.c']], ['75', ['gfx7_cmd_buffer.c']],61['80', ['gfx8_cmd_buffer.c']], ['90', ['gfx8_cmd_buffer.c']],62['110', ['gfx8_cmd_buffer.c']], ['120', ['gfx8_cmd_buffer.c']],63['125', ['gfx8_cmd_buffer.c']]]64_gfx_ver = g[0]65libanv_per_hw_ver_libs += static_library(66'anv_per_hw_ver@0@'.format(_gfx_ver),67[anv_per_hw_ver_files, g[1], anv_entrypoints[0]],68include_directories : [69inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_compiler, inc_intel, inc_vulkan_wsi,70],71c_args : [72no_override_init_args, c_sse2_args,73'-DGFX_VERx10=@0@'.format(_gfx_ver),74],75gnu_symbol_visibility : 'hidden',76dependencies : [77dep_libdrm, dep_valgrind, idep_nir_headers, idep_genxml, idep_vulkan_util_headers,78],79)80endforeach8182libanv_files = files(83'anv_acceleration_structure.c',84'anv_allocator.c',85'anv_android.h',86'anv_batch_chain.c',87'anv_blorp.c',88'anv_cmd_buffer.c',89'anv_descriptor_set.c',90'anv_device.c',91'anv_formats.c',92'anv_genX.h',93'anv_image.c',94'anv_measure.c',95'anv_measure.h',96'anv_nir.h',97'anv_nir_add_base_work_group_id.c',98'anv_nir_apply_pipeline_layout.c',99'anv_nir_compute_push_layout.c',100'anv_nir_lower_multiview.c',101'anv_nir_lower_ubo_loads.c',102'anv_nir_lower_ycbcr_textures.c',103'anv_pass.c',104'anv_perf.c',105'anv_pipeline.c',106'anv_pipeline_cache.c',107'anv_private.h',108'anv_queue.c',109'anv_util.c',110'anv_wsi.c',111)112113anv_deps = [114dep_libdrm,115dep_valgrind,116idep_genxml,117idep_nir_headers,118idep_vulkan_util_headers,119]120anv_flags = [121no_override_init_args,122c_sse2_args,123]124125if with_platform_x11126anv_deps += dep_xcb_dri3127anv_flags += [128'-DVK_USE_PLATFORM_XCB_KHR',129'-DVK_USE_PLATFORM_XLIB_KHR',130]131libanv_files += files('anv_wsi_x11.c')132endif133134if with_platform_wayland135anv_deps += dep_wayland_client136anv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'137libanv_files += files('anv_wsi_wayland.c')138endif139140if system_has_kms_drm and not with_platform_android141anv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'142libanv_files += files('anv_wsi_display.c')143endif144145if with_xlib_lease146anv_deps += [dep_xlib_xrandr]147anv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'148endif149150if with_platform_android151anv_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'152libanv_files += files('anv_android.c')153else154libanv_files += files('anv_android_stubs.c')155endif156157libanv_common = static_library(158'anv_common',159[160libanv_files, anv_entrypoints, sha1_h,161gen_xml_pack,162],163include_directories : [164inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,165inc_vulkan_wsi, inc_util,166],167c_args : anv_flags,168gnu_symbol_visibility : 'hidden',169dependencies : anv_deps,170)171172libvulkan_intel = shared_library(173'vulkan_intel',174[files('anv_gem.c'), anv_entrypoints[0]],175include_directories : [176inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,177],178link_whole : [libanv_common, libanv_per_hw_ver_libs],179link_with : [180libintel_compiler, libintel_dev, libisl, libblorp, libvulkan_wsi,181libintel_perf,182],183dependencies : [184dep_thread, dep_dl, dep_m, anv_deps, idep_libintel_common,185idep_nir, idep_genxml, idep_vulkan_util, idep_mesautil, idep_xmlconfig,186],187c_args : anv_flags,188gnu_symbol_visibility : 'hidden',189link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],190install : true,191)192193if with_symbols_check194test(195'anv symbols check',196symbols_check,197args : [198'--lib', libvulkan_intel,199'--symbols-file', vulkan_icd_symbols,200symbols_check_args,201],202suite : ['intel'],203)204endif205206if with_tests207libvulkan_intel_test = static_library(208'vulkan_intel_test',209[files('anv_gem_stubs.c'), anv_entrypoints[0]],210include_directories : [211inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,212],213link_whole : libanv_common,214link_with : [215libanv_per_hw_ver_libs, libintel_compiler, libintel_common, libintel_dev,216libisl, libblorp, libvulkan_wsi, libintel_perf,217],218dependencies : [219dep_thread, dep_dl, dep_m, anv_deps,220idep_nir, idep_vulkan_util, idep_mesautil,221],222c_args : anv_flags,223gnu_symbol_visibility : 'hidden',224)225226foreach t : ['block_pool_no_free', 'block_pool_grow_first',227'state_pool_no_free', 'state_pool_free_list_only',228'state_pool', 'state_pool_padding']229test(230'anv_@0@'.format(t),231executable(232t,233['tests/@[email protected]'.format(t), anv_entrypoints[0]],234c_args : [ c_sse2_args ],235link_with : libvulkan_intel_test,236dependencies : [dep_libdrm, dep_thread, dep_m, dep_valgrind, idep_vulkan_util, ],237include_directories : [238inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,239],240),241suite : ['intel'],242)243endforeach244endif245246247