1# Copyright © 2017 Intel Corporation 2 3# Permission is hereby granted, free of charge, to any person obtaining a copy 4# of this software and associated documentation files (the "Software"), to deal 5# in the Software without restriction, including without limitation the rights 6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7# copies of the Software, and to permit persons to whom the Software is 8# furnished to do so, subject to the following conditions: 9 10# The above copyright notice and this permission notice shall be included in 11# all copies or substantial portions of the Software. 12 13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19# SOFTWARE. 20 21radv_entrypoints = custom_target( 22 'radv_entrypoints.[ch]', 23 input : ['radv_entrypoints_gen.py', vk_api_xml], 24 output : ['radv_entrypoints.h', 'radv_entrypoints.c'], 25 command : [ 26 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--outdir', 27 meson.current_build_dir() 28 ], 29 depend_files : files('radv_extensions.py'), 30) 31 32radv_extensions_c = custom_target( 33 'radv_extensions.c', 34 input : ['radv_extensions.py', vk_api_xml], 35 output : ['radv_extensions.c', 'radv_extensions.h'], 36 command : [ 37 prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@', 38 '--out-h', '@OUTPUT1@' 39 ], 40) 41 42amd_vk_format_table_c = custom_target( 43 'amd_vk_format_table.c', 44 input : ['vk_format_table.py', 'vk_format_layout.csv'], 45 output : 'vk_format_table.c', 46 command : [prog_python, '@INPUT@'], 47 depend_files : files('vk_format_parse.py'), 48 capture : true, 49) 50 51libradv_files = files( 52 'layers/radv_sqtt_layer.c', 53 'winsys/amdgpu/radv_amdgpu_bo.c', 54 'winsys/amdgpu/radv_amdgpu_bo.h', 55 'winsys/amdgpu/radv_amdgpu_cs.c', 56 'winsys/amdgpu/radv_amdgpu_cs.h', 57 'winsys/amdgpu/radv_amdgpu_surface.c', 58 'winsys/amdgpu/radv_amdgpu_surface.h', 59 'winsys/amdgpu/radv_amdgpu_winsys.c', 60 'winsys/amdgpu/radv_amdgpu_winsys.h', 61 'winsys/amdgpu/radv_amdgpu_winsys_public.h', 62 'winsys/null/radv_null_bo.c', 63 'winsys/null/radv_null_bo.h', 64 'winsys/null/radv_null_cs.c', 65 'winsys/null/radv_null_cs.h', 66 'winsys/null/radv_null_winsys.c', 67 'winsys/null/radv_null_winsys_public.h', 68 'radv_android.c', 69 'radv_cmd_buffer.c', 70 'radv_cs.h', 71 'radv_debug.c', 72 'radv_debug.h', 73 'radv_device.c', 74 'radv_descriptor_set.c', 75 'radv_descriptor_set.h', 76 'radv_formats.c', 77 'radv_image.c', 78 'radv_llvm_helper.cpp', 79 'radv_meta.c', 80 'radv_meta.h', 81 'radv_meta_blit.c', 82 'radv_meta_blit2d.c', 83 'radv_meta_buffer.c', 84 'radv_meta_bufimage.c', 85 'radv_meta_clear.c', 86 'radv_meta_copy.c', 87 'radv_meta_decompress.c', 88 'radv_meta_fast_clear.c', 89 'radv_meta_fmask_expand.c', 90 'radv_meta_resolve.c', 91 'radv_meta_resolve_cs.c', 92 'radv_meta_resolve_fs.c', 93 'radv_nir_lower_ycbcr_textures.c', 94 'radv_nir_to_llvm.c', 95 'radv_pass.c', 96 'radv_pipeline.c', 97 'radv_pipeline_cache.c', 98 'radv_private.h', 99 'radv_radeon_winsys.h', 100 'radv_rgp.c', 101 'radv_shader.c', 102 'radv_shader.h', 103 'radv_shader_args.c', 104 'radv_shader_args.h', 105 'radv_shader_helper.h', 106 'radv_shader_info.c', 107 'radv_sqtt.c', 108 'radv_query.c', 109 'radv_util.c', 110 'radv_util.h', 111 'radv_wsi.c', 112 'si_cmd_buffer.c', 113 'vk_format.h', 114) 115 116radv_deps = [] 117radv_flags = [] 118 119if with_platform_x11 120 radv_deps += dep_xcb_dri3 121 radv_flags += [ 122 '-DVK_USE_PLATFORM_XCB_KHR', 123 '-DVK_USE_PLATFORM_XLIB_KHR', 124 ] 125 libradv_files += files('radv_wsi_x11.c') 126endif 127 128if with_platform_wayland 129 radv_deps += dep_wayland_client 130 radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR' 131 libradv_files += files('radv_wsi_wayland.c') 132endif 133 134if system_has_kms_drm and not with_platform_android 135 radv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR' 136 libradv_files += files('radv_wsi_display.c') 137endif 138 139if with_xlib_lease 140 radv_deps += [dep_xcb_xrandr, dep_xlib_xrandr] 141 radv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT' 142endif 143 144if with_platform_android 145 radv_deps += dep_android 146 radv_flags += [ 147 '-DVK_USE_PLATFORM_ANDROID_KHR' 148 ] 149endif 150 151# When static linking LLVM, all its symbols are public API. 152# That may cause symbol collision, so explicitly demote everything. 153libvulkan_radeon_ld_args = [] 154libvulkan_radeon_link_depends = [] 155 156if with_llvm and with_ld_version_script 157 libvulkan_radeon_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan.sym')] 158 libvulkan_radeon_link_depends += files('vulkan.sym') 159endif 160 161libvulkan_radeon = shared_library( 162 'vulkan_radeon', 163 [libradv_files, radv_entrypoints, radv_extensions_c, amd_vk_format_table_c, sha1_h], 164 include_directories : [ 165 inc_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, 166 ], 167 link_with : [ 168 libamd_common, libamd_common_llvm, libamdgpu_addrlib, libvulkan_wsi, 169 ], 170 dependencies : [ 171 dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m, 172 dep_valgrind, radv_deps, idep_aco, 173 idep_mesautil, idep_nir, idep_vulkan_util, idep_amdgfxregs_h, idep_xmlconfig, 174 ], 175 c_args : [no_override_init_args, radv_flags], 176 cpp_args : [radv_flags], 177 link_args : [ 178 ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args, 179 ], 180 link_depends : [libvulkan_radeon_link_depends,], 181 gnu_symbol_visibility : 'hidden', 182 install : true, 183) 184 185if with_symbols_check 186 test( 187 'radv symbols check', 188 symbols_check, 189 args : [ 190 '--lib', libvulkan_radeon, 191 '--symbols-file', vulkan_icd_symbols, 192 '--ignore-symbol', 'ac_init_shared_llvm_once', 193 symbols_check_args, 194 ], 195 suite : ['amd'], 196 ) 197endif 198 199radeon_icd = custom_target( 200 'radeon_icd', 201 input : 'radv_icd.py', 202 output : 'radeon_icd.@0@.json'.format(host_machine.cpu()), 203 command : [ 204 prog_python, '@INPUT@', 205 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')), 206 '--out', '@OUTPUT@', 207 ], 208 depend_files : files('radv_extensions.py'), 209 build_by_default : true, 210 install_dir : with_vulkan_icd_dir, 211 install : true, 212) 213