xref: /aosp_15_r20/external/mesa3d/src/gallium/targets/va/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2017-2018 Intel Corporation
2# SPDX-License-Identifier: MIT
3
4# TODO: support non-static targets
5# Static targets are always enabled in autotools (unless you modify
6# configure.ac)
7
8va_link_args = []
9va_link_depends = []
10va_drivers = []
11
12va_sym = configure_file(input : 'va.sym.in', output : 'va.sym', configuration : sym_config)
13
14if with_ld_version_script
15  va_link_args += ['-Wl,--version-script', join_paths(meson.current_build_dir(), 'va.sym')]
16  va_link_depends += va_sym
17endif
18if with_ld_dynamic_list
19  va_link_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri.dyn')]
20  va_link_depends += files('../dri.dyn')
21endif
22
23link_with_libva_gallium = [
24  libgalliumvlwinsys, libgalliumvl, libgallium,
25  libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
26]
27
28if with_glx == 'xlib'
29  link_with_libva_gallium += [libws_xlib]
30endif
31
32devenv.set('LIBVA_DRIVERS_PATH', meson.current_build_dir())
33
34if host_machine.system() == 'windows'
35  link_with_libva_gallium += [libwsgdi]
36
37  libva_init_version = dep_va.version().split('.')
38  vaon12_def_input = configure_file(
39    configuration: {
40      '__vaDriverInit_X_Y': '__vaDriverInit_@0@_@1@'.format(libva_init_version[0], libva_init_version[1]) + '@4'
41    },
42    input: 'vaon12.def.in',
43    output: 'vaon12.def.in',
44  )
45
46  vaon12_def = custom_target(
47    'vaon12.def',
48    input: vaon12_def_input,
49    output : 'vaon12.def',
50    command : gen_vs_module_defs_normal_command,
51  )
52
53  libva_gallium = shared_library(
54    'vaon12_drv_video',
55    'va_target.c',
56    link_args : [va_link_args, ld_args_gc_sections, ld_args_build_id],
57    vs_module_defs : vaon12_def,
58    include_directories : [
59      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers, inc_gallium_winsys_sw
60    ],
61    link_whole : [libva_st],
62    link_with : link_with_libva_gallium,
63    dependencies : [driver_d3d12, idep_mesautil],
64    link_depends : va_link_depends,
65    install : true,
66    name_suffix : 'dll',
67    name_prefix : '',  # otherwise mingw will create libvaon12_drv_video.dll
68  )
69else
70  libva_gallium = shared_library(
71    'gallium_drv_video',
72    'va_target.c',
73    gnu_symbol_visibility : 'hidden',
74    link_args : [va_link_args, ld_args_gc_sections, ld_args_build_id],
75    include_directories : [
76      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
77    ],
78    link_whole : [libva_st],
79    link_with : link_with_libva_gallium,
80    dependencies : [
81      dep_libdrm, driver_r600, driver_radeonsi, driver_nouveau, driver_d3d12, driver_virgl,
82      idep_mesautil,
83    ],
84    link_depends : va_link_depends,
85    install : true,
86    install_dir : va_drivers_path,
87    name_suffix : 'so',
88  )
89
90  foreach d : [[with_gallium_r600, 'r600'],
91              [with_gallium_radeonsi, 'radeonsi'],
92              [with_gallium_nouveau, 'nouveau'],
93              [with_gallium_virgl, 'virtio_gpu'],
94              [with_gallium_d3d12_video, 'd3d12']]
95    if d[0]
96      va_drivers += '@0@_drv_video.so'.format(d[1])
97    endif
98  endforeach
99
100  if va_drivers.length() > 0
101    meson.add_install_script(
102      install_megadrivers_py.full_path(),
103      libva_gallium.full_path(),
104      va_drivers_path,
105      va_drivers,
106      install_tag : 'runtime',
107    )
108  endif
109endif
110