| 1 |
# Copyright 2022 Android Open Source Project |
| 2 |
# SPDX-License-Identifier: MIT |
| 3 |
|
| 4 |
if with_platform_android |
| 5 |
dep_gfxstream_stubs = null_dep |
| 6 |
else |
| 7 |
subdir('stubs') |
| 8 |
endif |
| 9 |
|
| 10 |
gfxstream_deps += dep_gfxstream_stubs |
| 11 |
|
| 12 |
files_lib_vulkan_gfxstream = files( |
| 13 |
'gfxstream_vk_cmd.cpp', |
| 14 |
'gfxstream_vk_device.cpp', |
| 15 |
'gfxstream_vk_wsi.cpp', |
| 16 |
) |
| 17 |
|
| 18 |
gfxstream_vk_wsi_args = [] |
| 19 |
if with_platform_x11 |
| 20 |
gfxstream_vk_wsi_args += '-DGFXSTREAM_VK_X11' |
| 21 |
endif |
| 22 |
|
| 23 |
if with_platform_wayland |
| 24 |
gfxstream_vk_wsi_args += '-DGFXSTREAM_VK_WAYLAND' |
| 25 |
endif |
| 26 |
|
| 27 |
files_vulkan_gfxstream = files_lib_vulkan_gfxstream + files_lib_vulkan_enc |
| 28 |
files_vulkan_gfxstream += gfxstream_vk_entrypoints |
| 29 |
files_vulkan_gfxstream += gfxstream_guest_vk_autogen |
| 30 |
files_vulkan_gfxstream += vulkan_gfxstream_h |
| 31 |
|
| 32 |
if with_platform_android or with_gfxstream_emulated_android |
| 33 |
files_vulkan_gfxstream += files_lib_vulkan_enc_android |
| 34 |
endif |
| 35 |
|
| 36 |
lib_vulkan_gfxstream = shared_library( |
| 37 |
'vulkan_gfxstream', |
| 38 |
files_vulkan_gfxstream, |
| 39 |
cpp_args: gfxstream_guest_args + gfxstream_vk_wsi_args, |
| 40 |
include_directories: [ |
| 41 |
inc_vulkan_headers, |
| 42 |
inc_guest_iostream, |
| 43 |
inc_vulkan_enc, |
| 44 |
inc_goldfish_address_space, |
| 45 |
inc_include, |
| 46 |
inc_src, |
| 47 |
inc_aemu, |
| 48 |
inc_platform_virtgpu, |
| 49 |
inc_connection_manager, |
| 50 |
], |
| 51 |
link_with: [ |
| 52 |
libvulkan_wsi, |
| 53 |
libplatform_virtgpu, |
| 54 |
libconnection_manager, |
| 55 |
libaemu, |
| 56 |
], |
| 57 |
link_args: [vulkan_icd_link_args, ld_args_bsymbolic, ld_args_gc_sections], |
| 58 |
link_depends: vulkan_icd_link_depends, |
| 59 |
dependencies: gfxstream_deps, |
| 60 |
install: true, |
| 61 |
) |
| 62 |
|
| 63 |
icd_file_name = libname_prefix + 'vulkan_gfxstream.' + libname_suffix |
| 64 |
|
| 65 |
gfxstream_icd = custom_target( |
| 66 |
'gfxstream_vk_icd', |
| 67 |
input: [vk_icd_gen, vk_api_xml], |
| 68 |
output: 'gfxstream_vk_icd.' + vulkan_manifest_suffix, |
| 69 |
command: [ |
| 70 |
prog_python, |
| 71 |
'@INPUT0@', |
| 72 |
'--api-version', |
| 73 |
'1.1', |
| 74 |
'--xml', |
| 75 |
'@INPUT1@', |
| 76 |
'--sizeof-pointer', |
| 77 |
sizeof_pointer, |
| 78 |
'--icd-lib-path', |
| 79 |
vulkan_icd_lib_path, |
| 80 |
'--icd-filename', |
| 81 |
icd_file_name, |
| 82 |
'--out', |
| 83 |
'@OUTPUT@', |
| 84 |
], |
| 85 |
build_by_default: true, |
| 86 |
install_dir: with_vulkan_icd_dir, |
| 87 |
install: true, |
| 88 |
) |
| 89 |
|
| 90 |
_dev_icdname = 'gfxstream_vk_devenv_icd.@[email protected]'.format(host_machine.cpu()) |
| 91 |
_dev_icd = custom_target( |
| 92 |
'gfxstream_vk_devenv_icd', |
| 93 |
input: [vk_icd_gen, vk_api_xml], |
| 94 |
output: _dev_icdname, |
| 95 |
command: [ |
| 96 |
prog_python, |
| 97 |
'@INPUT0@', |
| 98 |
'--api-version', |
| 99 |
'1.3', |
| 100 |
'--xml', |
| 101 |
'@INPUT1@', |
| 102 |
'--sizeof-pointer', |
| 103 |
sizeof_pointer, |
| 104 |
'--icd-lib-path', |
| 105 |
meson.current_build_dir(), |
| 106 |
'--icd-filename', |
| 107 |
icd_file_name, |
| 108 |
'--out', |
| 109 |
'@OUTPUT@', |
| 110 |
], |
| 111 |
build_by_default: true, |
| 112 |
) |
| 113 |
|
| 114 |
devenv.append('VK_DRIVER_FILES', _dev_icd.full_path()) |