Path: blob/21.2-virgl/src/amd/vulkan/meson.build
7130 views
# Copyright © 2017 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.1920radv_entrypoints = custom_target(21'radv_entrypoints',22input : [vk_entrypoints_gen, vk_api_xml],23output : ['radv_entrypoints.h', 'radv_entrypoints.c'],24command : [25prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',26'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'radv',27'--device-prefix', 'sqtt',28],29depend_files : vk_entrypoints_gen_depend_files,30)3132libradv_files = files(33'layers/radv_sqtt_layer.c',34'winsys/null/radv_null_bo.c',35'winsys/null/radv_null_bo.h',36'winsys/null/radv_null_cs.c',37'winsys/null/radv_null_cs.h',38'winsys/null/radv_null_winsys.c',39'winsys/null/radv_null_winsys_public.h',40'radv_acceleration_structure.c',41'radv_android.c',42'radv_cmd_buffer.c',43'radv_cs.h',44'radv_debug.c',45'radv_debug.h',46'radv_device.c',47'radv_descriptor_set.c',48'radv_descriptor_set.h',49'radv_formats.c',50'radv_image.c',51'radv_llvm_helper.cpp',52'radv_meta.c',53'radv_meta.h',54'radv_meta_blit.c',55'radv_meta_blit2d.c',56'radv_meta_buffer.c',57'radv_meta_bufimage.c',58'radv_meta_clear.c',59'radv_meta_copy.c',60'radv_meta_copy_vrs_htile.c',61'radv_meta_dcc_retile.c',62'radv_meta_decompress.c',63'radv_meta_fast_clear.c',64'radv_meta_fmask_expand.c',65'radv_meta_resolve.c',66'radv_meta_resolve_cs.c',67'radv_meta_resolve_fs.c',68'radv_nir_lower_ycbcr_textures.c',69'radv_nir_to_llvm.c',70'radv_pass.c',71'radv_pipeline.c',72'radv_pipeline_cache.c',73'radv_private.h',74'radv_radeon_winsys.h',75'radv_shader.c',76'radv_shader.h',77'radv_shader_args.c',78'radv_shader_args.h',79'radv_shader_helper.h',80'radv_shader_info.c',81'radv_sqtt.c',82'radv_query.c',83'radv_util.c',84'radv_wsi.c',85'si_cmd_buffer.c',86'vk_format.h',87)8889if not with_platform_windows90libradv_files += files(91'winsys/amdgpu/radv_amdgpu_bo.c',92'winsys/amdgpu/radv_amdgpu_bo.h',93'winsys/amdgpu/radv_amdgpu_cs.c',94'winsys/amdgpu/radv_amdgpu_cs.h',95'winsys/amdgpu/radv_amdgpu_surface.c',96'winsys/amdgpu/radv_amdgpu_surface.h',97'winsys/amdgpu/radv_amdgpu_winsys.c',98'winsys/amdgpu/radv_amdgpu_winsys.h',99'winsys/amdgpu/radv_amdgpu_winsys_public.h',100)101endif102103radv_deps = []104radv_flags = cc.get_supported_arguments(['-Wimplicit-fallthrough', '-Wshadow', '-Wpointer-arith'])105106if with_platform_x11107radv_deps += dep_xcb_dri3108radv_flags += [109'-DVK_USE_PLATFORM_XCB_KHR',110'-DVK_USE_PLATFORM_XLIB_KHR',111]112libradv_files += files('radv_wsi_x11.c')113endif114115if with_platform_wayland116radv_deps += dep_wayland_client117radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'118libradv_files += files('radv_wsi_wayland.c')119endif120121if system_has_kms_drm and not with_platform_android122radv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'123libradv_files += files('radv_wsi_display.c')124endif125126if with_xlib_lease127radv_deps += [dep_xlib_xrandr]128radv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'129endif130131if with_platform_android132radv_deps += dep_android133radv_flags += [134'-DVK_USE_PLATFORM_ANDROID_KHR'135]136endif137138if with_platform_windows139radv_flags += [140'-DVK_USE_PLATFORM_WIN32_KHR',141]142endif143144# When static linking LLVM, all its symbols are public API.145# That may cause symbol collision, so explicitly demote everything.146libvulkan_radeon_ld_args = []147libvulkan_radeon_link_depends = []148149if with_llvm and with_ld_version_script150libvulkan_radeon_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan.sym')]151libvulkan_radeon_link_depends += files('vulkan.sym')152endif153154vulkan_radv_def = 'vulkan_radv.def'155156libvulkan_radeon = shared_library(157'vulkan_radeon',158[libradv_files, radv_entrypoints, sha1_h],159vs_module_defs : vulkan_radv_def,160include_directories : [161inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_amd, inc_amd_common, inc_amd_common_llvm, inc_compiler, inc_util, inc_vulkan_wsi,162],163link_with : [164libamd_common, libamd_common_llvm, libamdgpu_addrlib, libvulkan_wsi,165],166dependencies : [167dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,168dep_valgrind, radv_deps, idep_aco,169idep_mesautil, idep_nir, idep_vulkan_util, idep_amdgfxregs_h, idep_xmlconfig,170],171c_args : [no_override_init_args, radv_flags],172cpp_args : [radv_flags],173link_args : [174ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args,175],176link_depends : [libvulkan_radeon_link_depends,],177gnu_symbol_visibility : 'hidden',178install : true,179)180181if with_symbols_check182test(183'radv symbols check',184symbols_check,185args : [186'--lib', libvulkan_radeon,187'--symbols-file', vulkan_icd_symbols,188'--ignore-symbol', 'ac_init_shared_llvm_once',189symbols_check_args,190],191suite : ['amd'],192)193endif194195icd_lib_path = join_paths(get_option('prefix'), get_option('libdir'))196icd_file_name = 'libvulkan_radeon.so'197if with_platform_windows198icd_lib_path = '.'199icd_file_name = 'vulkan_radeon.dll'200endif201202radeon_icd = custom_target(203'radeon_icd',204input : [vk_icd_gen, vk_api_xml],205output : 'radeon_icd.@[email protected]'.format(host_machine.cpu()),206command : [207prog_python, '@INPUT0@',208'--api-version', '1.2', '--xml', '@INPUT1@',209'--lib-path', join_paths(icd_lib_path, icd_file_name),210'--out', '@OUTPUT@',211],212build_by_default : true,213install_dir : with_vulkan_icd_dir,214install : true,215)216217218219