• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
71if with_gallium_va or with_gallium_vdpau
72  va_drivers = []
73  vdpau_drivers = []
74  foreach d : [[with_gallium_r600, 'r600'],
75              [with_gallium_radeonsi, 'radeonsi'],
76              [with_gallium_nouveau, 'nouveau'],
77              [with_gallium_virgl, 'virtio_gpu'],
78              [with_gallium_d3d12_video, 'd3d12']]
79    if d[0]
80      if with_gallium_va
81        va_drivers += '@0@_drv_video.so'.format(d[1])
82      endif
83      if with_gallium_vdpau
84        vdpau_drivers += 'libvdpau_@0@.so.@1@.@2@.0'.format(d[1], VDPAU_MAJOR, VDPAU_MINOR)
85      endif
86    endif
87  endforeach
88
89  if va_drivers.length() > 0
90    meson.add_install_script(
91      install_megadrivers,
92      libgallium_dri.full_path(),
93      va_drivers_path,
94      va_drivers,
95      '--megadriver-libdir', get_option('libdir'),
96      install_tag : 'runtime',
97    )
98  endif
99
100  if vdpau_drivers.length() > 0
101    meson.add_install_script(
102      install_megadrivers,
103      libgallium_dri.full_path(),
104      vdpau_drivers_path,
105      vdpau_drivers,
106      '--megadriver-libdir', get_option('libdir'),
107      install_tag : 'runtime',
108    )
109  endif
110endif
111