1# Copyright 2019 Google LLC 2# SPDX-License-Identifier: MIT 3# 4# based in part on anv and radv which are: 5# Copyright © 2017 Intel Corporation 6 7vn_entrypoints = custom_target( 8 'vn_entrypoints', 9 input : [vk_entrypoints_gen, vk_api_xml], 10 output : ['vn_entrypoints.h', 'vn_entrypoints.c'], 11 command : [ 12 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak', 13 '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vn', 14 '--beta', with_vulkan_beta.to_string() 15 ], 16) 17 18virtio_icd = custom_target( 19 'virtio_icd', 20 input : [vk_icd_gen, vk_api_xml], 21 output : 'virtio_icd.@0@.json'.format(host_machine.cpu()), 22 command : [ 23 prog_python, '@INPUT0@', 24 '--api-version', '1.3', '--xml', '@INPUT1@', 25 '--lib-path', join_paths(get_option('prefix'), get_option('libdir'), 26 'libvulkan_virtio.so'), 27 '--out', '@OUTPUT@', 28 ], 29 build_by_default : true, 30 install_dir : with_vulkan_icd_dir, 31 install_tag : 'runtime', 32 install : true, 33) 34 35_dev_icdname = 'virtio_devenv_icd.@0@.json'.format(host_machine.cpu()) 36_dev_icd = custom_target( 37 'virtio_devenv_icd', 38 input : [vk_icd_gen, vk_api_xml], 39 output : _dev_icdname, 40 command : [ 41 prog_python, '@INPUT0@', 42 '--api-version', '1.3', '--xml', '@INPUT1@', 43 '--lib-path', meson.current_build_dir() / 'libvulkan_virtio.so', 44 '--out', '@OUTPUT@', 45 ], 46 build_by_default : true, 47) 48 49devenv.append('VK_ICD_FILENAMES', _dev_icd.full_path()) 50 51libvn_files = files( 52 'vn_buffer.c', 53 'vn_command_buffer.c', 54 'vn_common.c', 55 'vn_cs.c', 56 'vn_descriptor_set.c', 57 'vn_device.c', 58 'vn_device_memory.c', 59 'vn_feedback.c', 60 'vn_icd.c', 61 'vn_image.c', 62 'vn_instance.c', 63 'vn_physical_device.c', 64 'vn_pipeline.c', 65 'vn_query_pool.c', 66 'vn_queue.c', 67 'vn_render_pass.c', 68 'vn_ring.c', 69 'vn_renderer_internal.c', 70 'vn_renderer_util.c', 71 'vn_renderer_virtgpu.c', 72 'vn_renderer_vtest.c', 73) 74 75vn_deps = [ 76 dep_libdrm, 77 dep_thread, 78 idep_mesautil, 79 idep_vulkan_util, 80 idep_vulkan_runtime, 81 idep_vulkan_wsi, 82 idep_xmlconfig, 83] 84 85vn_flags = [ 86 no_override_init_args, 87] 88 89vn_libs = [] 90 91if with_platform_wayland or with_platform_x11 92 libvn_files += files('vn_wsi.c') 93 libvn_files += wsi_entrypoints[0] 94 vn_flags += '-DVN_USE_WSI_PLATFORM' 95endif 96 97if with_platform_wayland 98 vn_deps += dep_wayland_client 99endif 100 101if with_platform_x11 102 vn_deps += dep_xcb_dri3 103endif 104 105if with_platform_android 106 libvn_files += files('vn_android.c') 107 vn_deps += [dep_android, idep_u_gralloc] 108endif 109 110libvulkan_virtio = shared_library( 111 'vulkan_virtio', 112 [libvn_files, vn_entrypoints, sha1_h], 113 include_directories : [ 114 inc_include, inc_src, inc_virtio, 115 ], 116 link_with : vn_libs, 117 dependencies : [vn_deps], 118 c_args : [vn_flags], 119 link_args : [vulkan_icd_link_args, ld_args_bsymbolic, ld_args_gc_sections], 120 link_depends : vulkan_icd_link_depends, 121 gnu_symbol_visibility : 'hidden', 122 install : true, 123) 124