1# Copyright © 2017 Dylan Baker 2# Copyright © 2018 Intel Corporation 3# SPDX-License-Identifier: MIT 4 5# TODO: support non-static targets 6# Static targets are always enabled in autotools (unless you modify 7# configure.ac) 8 9gallium_dri_c_args = [] 10gallium_dri_ld_args = [cc.get_supported_link_arguments('-Wl,--default-symver')] 11gallium_dri_link_depends = [] 12gallium_dri_drivers = [] 13gallium_dri_link_with = [] 14gallium_dri_link_whole = [] 15 16if with_gallium_va or with_gallium_vdpau 17 gallium_dri_link_with += [libgalliumvlwinsys] 18 if with_gallium_va 19 gallium_dri_link_whole += [libva_st] 20 endif 21 if with_gallium_vdpau 22 gallium_dri_link_whole += [libvdpau_st] 23 endif 24endif 25 26dri_sym = configure_file(input : 'dri.sym.in', output : 'dri.sym', configuration : sym_config) 27 28if with_ld_version_script 29 gallium_dri_ld_args += ['-Wl,--version-script', join_paths(meson.current_build_dir(), 'dri.sym')] 30 gallium_dri_link_depends += dri_sym 31endif 32if with_ld_dynamic_list 33 gallium_dri_ld_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri.dyn')] 34 gallium_dri_link_depends += files('../dri.dyn') 35endif 36 37if get_option('unversion-libgallium') or with_platform_android 38 libgallium_name = 'gallium_dri' 39else 40 libgallium_name = 'gallium-@0@'.format(meson.project_version()) 41endif 42 43libgallium_dri = shared_library( 44 libgallium_name, 45 files('dri_target.c'), 46 include_directories : [ 47 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_drivers, 48 inc_gallium_winsys, include_directories('../../frontends/dri'), 49 ], 50 gnu_symbol_visibility : 'hidden', 51 link_args : [ld_args_build_id, ld_args_gc_sections, gallium_dri_ld_args], 52 link_depends : gallium_dri_link_depends, 53 link_with : [ 54 libmesa, libgalliumvl, 55 libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri, 56 libswkmsdri, gallium_dri_link_with 57 ], 58 link_whole : [libdri, gallium_dri_link_whole], 59 dependencies : [ 60 dep_libdrm, dep_llvm, dep_thread, idep_xmlconfig, idep_mesautil, 61 driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau, 62 driver_kmsro, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv, 63 driver_tegra, driver_i915, driver_svga, driver_virgl, 64 driver_panfrost, driver_iris, driver_lima, driver_zink, driver_d3d12, 65 driver_asahi, driver_crocus 66 ], 67 install : true, 68 name_suffix : libname_suffix, 69) 70 71shared_glapi_lib = libgallium_dri 72 73if with_gallium_va or with_gallium_vdpau 74 va_drivers = [] 75 vdpau_drivers = [] 76 foreach d : [[with_gallium_r600, 'r600'], 77 [with_gallium_radeonsi, 'radeonsi'], 78 [with_gallium_nouveau, 'nouveau'], 79 [with_gallium_virgl, 'virtio_gpu'], 80 [with_gallium_d3d12_video, 'd3d12']] 81 if d[0] 82 if with_gallium_va 83 va_drivers += '@0@_drv_video.so'.format(d[1]) 84 endif 85 if with_gallium_vdpau 86 vdpau_drivers += 'libvdpau_@0@.so.@1@.@2@.0'.format(d[1], VDPAU_MAJOR, VDPAU_MINOR) 87 endif 88 endif 89 endforeach 90 91 if va_drivers.length() > 0 92 meson.add_install_script( 93 install_megadrivers, 94 libgallium_dri.full_path(), 95 va_drivers_path, 96 va_drivers, 97 '--megadriver-libdir', get_option('libdir'), 98 install_tag : 'runtime', 99 ) 100 endif 101 102 if vdpau_drivers.length() > 0 103 meson.add_install_script( 104 install_megadrivers, 105 libgallium_dri.full_path(), 106 vdpau_drivers_path, 107 vdpau_drivers, 108 '--megadriver-libdir', get_option('libdir'), 109 install_tag : 'runtime', 110 ) 111 endif 112endif 113