• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2017-2018 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
21# TODO: support non-static targets
22# Static targets are always enabled in autotools (unless you modify
23# configure.ac)
24
25va_link_args = []
26va_link_depends = []
27va_drivers = []
28
29va_sym = configure_file(input : 'va.sym.in', output : 'va.sym', configuration : sym_config)
30
31if with_ld_version_script
32  va_link_args += ['-Wl,--version-script', join_paths(meson.current_build_dir(), 'va.sym')]
33  va_link_depends += va_sym
34endif
35if with_ld_dynamic_list
36  va_link_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri.dyn')]
37  va_link_depends += files('../dri.dyn')
38endif
39
40link_with_libva_gallium = [
41  libgalliumvlwinsys, libgalliumvl, libgallium,
42  libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
43]
44
45if with_glx == 'xlib'
46  link_with_libva_gallium += [libws_xlib]
47endif
48
49devenv.set('LIBVA_DRIVERS_PATH', meson.current_build_dir())
50
51if host_machine.system() == 'windows'
52  link_with_libva_gallium += [libwsgdi]
53
54  libva_init_version = dep_va.version().split('.')
55  vaon12_def_input = configure_file(
56    configuration: {
57      '__vaDriverInit_X_Y': '__vaDriverInit_@0@_@1@'.format(libva_init_version[0], libva_init_version[1]) + '@4'
58    },
59    input: 'vaon12.def.in',
60    output: 'vaon12.def.in',
61  )
62
63  vaon12_def = custom_target(
64    'vaon12.def',
65    input: vaon12_def_input,
66    output : 'vaon12.def',
67    command : gen_vs_module_defs_normal_command,
68  )
69
70  libva_gallium = shared_library(
71    'vaon12_drv_video',
72    'target.c',
73    link_args : [va_link_args, ld_args_gc_sections, ld_args_build_id],
74    vs_module_defs : vaon12_def,
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, inc_gallium_winsys_sw
77    ],
78    link_whole : [libva_st],
79    link_with : link_with_libva_gallium,
80    dependencies : [driver_d3d12, idep_mesautil],
81    link_depends : va_link_depends,
82    install : true,
83    name_suffix : 'dll',
84    name_prefix : '',  # otherwise mingw will create libvaon12_drv_video.dll
85  )
86else
87  libva_gallium = shared_library(
88    'gallium_drv_video',
89    'target.c',
90    gnu_symbol_visibility : 'hidden',
91    link_args : [va_link_args, ld_args_gc_sections, ld_args_build_id],
92    include_directories : [
93      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
94    ],
95    link_whole : [libva_st],
96    link_with : link_with_libva_gallium,
97    dependencies : [
98      dep_libdrm, driver_r600, driver_radeonsi, driver_nouveau, driver_d3d12, driver_virgl,
99      idep_mesautil,
100    ],
101    link_depends : va_link_depends,
102    # Will be deleted during installation, see install_megadrivers.py
103    install : true,
104    install_dir : va_drivers_path,
105    name_suffix : 'so',
106  )
107
108  foreach d : [[with_gallium_r600, 'r600'],
109              [with_gallium_radeonsi, 'radeonsi'],
110              [with_gallium_nouveau, 'nouveau'],
111              [with_gallium_virgl, 'virtio_gpu'],
112              [with_gallium_d3d12_video, 'd3d12']]
113    if d[0]
114      va_drivers += '@0@_drv_video.so'.format(d[1])
115    endif
116  endforeach
117
118  meson.add_install_script(
119    install_megadrivers_py.full_path(),
120    libva_gallium.full_path(),
121    va_drivers_path,
122    va_drivers,
123    install_tag : 'runtime',
124  )
125endif
126