xref: /aosp_15_r20/external/mesa3d/src/gallium/targets/dri/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
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    sym_config.set('va_driver_init', '__vaDriverInit_*_*;')
21  endif
22  if with_gallium_vdpau
23    gallium_dri_link_whole += [libvdpau_st]
24    sym_config.set('vdp_imp_device_create_x11', 'vdp_imp_device_create_x11;')
25  endif
26endif
27
28dri_sym = configure_file(input : 'dri.sym.in', output : 'dri.sym', configuration : sym_config)
29
30if with_ld_version_script
31  gallium_dri_ld_args += ['-Wl,--version-script', join_paths(meson.current_build_dir(), 'dri.sym')]
32  gallium_dri_link_depends += dri_sym
33endif
34if with_ld_dynamic_list
35  gallium_dri_ld_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri.dyn')]
36  gallium_dri_link_depends += files('../dri.dyn')
37endif
38
39if get_option('unversion-libgallium') or with_platform_android
40  libgallium_name = 'gallium_dri'
41else
42  libgallium_name = 'gallium-@0@'.format(meson.project_version())
43endif
44
45libgallium_dri = shared_library(
46  libgallium_name,
47  files('dri_target.c'),
48  include_directories : [
49    inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_drivers,
50    inc_gallium_winsys, include_directories('../../frontends/dri'),
51  ],
52  gnu_symbol_visibility : 'hidden',
53  link_args : [ld_args_build_id, ld_args_gc_sections, gallium_dri_ld_args],
54  link_depends : gallium_dri_link_depends,
55  link_with : [
56    libmesa, libgalliumvl,
57    libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
58    libswkmsdri, gallium_dri_link_with
59  ],
60  link_whole : [libdri, gallium_dri_link_whole],
61  dependencies : [
62    dep_selinux, dep_libdrm, dep_llvm, dep_thread, idep_xmlconfig, idep_mesautil,
63    driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
64    driver_kmsro, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv,
65    driver_tegra, driver_i915, driver_svga, driver_virgl,
66    driver_panfrost, driver_iris, driver_lima, driver_zink, driver_d3d12,
67    driver_asahi, driver_crocus
68  ],
69  install : true,
70  name_suffix : 'so',
71)
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_@[email protected].@1@.@[email protected]'.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_py.full_path(),
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_py.full_path(),
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