Path: blob/21.2-virgl/src/broadcom/vulkan/meson.build
4560 views
# Copyright © 2019 Raspberry Pi1#2# 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:8#9# The above copyright notice and this permission notice shall be included in10# all copies or substantial portions of the Software.11#12# 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.1920v3dv_entrypoints = custom_target(21'v3dv_entrypoints',22input : [vk_entrypoints_gen, vk_api_xml],23output : ['v3dv_entrypoints.h', 'v3dv_entrypoints.c'],24command : [25prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',26'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'v3dv',27'--device-prefix', 'ver42',28],29depend_files : vk_entrypoints_gen_depend_files,30)3132libv3dv_files = files(33'v3dv_bo.c',34'v3dv_cl.c',35'v3dv_cmd_buffer.c',36'v3dv_debug.c',37'v3dv_debug.h',38'v3dv_descriptor_set.c',39'v3dv_device.c',40'v3dv_formats.c',41'v3dv_image.c',42'v3dv_limits.h',43'v3dv_meta_clear.c',44'v3dv_meta_copy.c',45'v3dv_pass.c',46'v3dv_pipeline.c',47'v3dv_pipeline_cache.c',48'v3dv_private.h',49'v3dv_query.c',50'v3dv_queue.c',51'v3dv_uniforms.c',52'v3dv_util.c',53'v3dv_wsi.c',54)5556files_per_version = files(57'v3dvx_cmd_buffer.c',58'v3dvx_descriptor_set.c',59'v3dvx_device.c',60'v3dvx_formats.c',61'v3dvx_image.c',62'v3dvx_pipeline.c',63'v3dvx_meta_clear.c',64'v3dvx_meta_copy.c',65'v3dvx_pipeline.c',66'v3dvx_queue.c',67)6869# The vulkan driver only supports version >= 42, which is the version present in70# Rpi4. We need to explicitly set it as we are reusing pieces from the GL v3d71# driver.72v3d_versions = ['42']7374v3dv_flags = []7576dep_v3dv3 = dependency('v3dv3', required : false)77if dep_v3dv3.found()78v3dv_flags += '-DUSE_V3D_SIMULATOR'79endif8081v3dv_deps = [82dep_dl,83dep_libdrm,84dep_valgrind,85dep_v3dv3,86idep_nir,87idep_nir_headers,88idep_vulkan_util,89]9091if with_platform_x1192v3dv_deps += dep_xcb_dri393v3dv_flags += [94'-DVK_USE_PLATFORM_XCB_KHR',95'-DVK_USE_PLATFORM_XLIB_KHR',96]97libv3dv_files += files('v3dv_wsi_x11.c')98endif99100if with_platform_wayland101v3dv_deps += [dep_wayland_client, dep_wl_protocols]102v3dv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'103libv3dv_files += files('v3dv_wsi_wayland.c')104libv3dv_files += [wayland_drm_client_protocol_h, wayland_drm_protocol_c]105endif106107if system_has_kms_drm and not with_platform_android108v3dv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'109libv3dv_files += files('v3dv_wsi_display.c')110endif111112per_version_libs = []113foreach ver : v3d_versions114per_version_libs += static_library(115'v3dv-v' + ver,116[files_per_version, v3d_xml_pack, v3dv_entrypoints[0]],117include_directories : [118inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_broadcom,119inc_compiler, inc_util, inc_vulkan_wsi,120],121c_args : [v3dv_flags, '-DV3D_VERSION=' + ver],122gnu_symbol_visibility : 'hidden',123dependencies : [v3dv_deps],124)125endforeach126127libvulkan_broadcom = shared_library(128'vulkan_broadcom',129[libv3dv_files, v3dv_entrypoints, sha1_h],130include_directories : [131inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_broadcom, inc_compiler, inc_util, inc_vulkan_wsi,132],133link_with : [134libbroadcom_cle,135libbroadcom_v3d,136libvulkan_wsi,137per_version_libs,138],139dependencies : v3dv_deps,140c_args : v3dv_flags,141link_args : ['-Wl,--build-id=sha1', ld_args_bsymbolic, ld_args_gc_sections],142gnu_symbol_visibility : 'hidden',143install : true,144)145146if with_symbols_check147test(148'v3dv symbols check',149symbols_check,150args : [151'--lib', libvulkan_broadcom,152'--symbols-file', vulkan_icd_symbols,153symbols_check_args,154],155suite : ['broadcom'],156)157endif158159broadcom_icd = custom_target(160'broadcom_icd',161input : [vk_icd_gen, vk_api_xml],162output : 'broadcom_icd.@[email protected]'.format(host_machine.cpu()),163command : [164prog_python, '@INPUT0@',165'--api-version', '1.0', '--xml', '@INPUT1@',166'--lib-path', join_paths(get_option('prefix'), get_option('libdir'),167'libvulkan_broadcom.so'),168'--out', '@OUTPUT@',169],170build_by_default : true,171install_dir : with_vulkan_icd_dir,172install : true,173)174175176