• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  ],
15)
16
17virtio_icd = custom_target(
18  'virtio_icd',
19  input : [vk_icd_gen, vk_api_xml],
20  output : 'virtio_icd.@0@.json'.format(host_machine.cpu()),
21  command : [
22    prog_python, '@INPUT0@',
23    '--api-version', '1.2', '--xml', '@INPUT1@',
24    '--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
25                             'libvulkan_virtio.so'),
26    '--out', '@OUTPUT@',
27  ],
28  build_by_default : true,
29  install_dir : with_vulkan_icd_dir,
30  install : true,
31)
32
33if meson.version().version_compare('>= 0.58')
34  _dev_icdname = 'virtio_devenv_icd.@0@.json'.format(host_machine.cpu())
35  custom_target(
36    'virtio_devenv_icd',
37    input : [vk_icd_gen, vk_api_xml],
38    output : _dev_icdname,
39    command : [
40      prog_python, '@INPUT0@',
41      '--api-version', '1.2', '--xml', '@INPUT1@',
42      '--lib-path', meson.current_build_dir() / 'libvulkan_virtio.so',
43      '--out', '@OUTPUT@',
44    ],
45    build_by_default : true,
46  )
47
48  devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname)
49endif
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
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 : [ld_args_bsymbolic, ld_args_gc_sections],
120  gnu_symbol_visibility : 'hidden',
121  install : true,
122)
123