1bf215546Sopenharmony_ci# Copyright © 2017-2018 Intel Corporation
2bf215546Sopenharmony_ci
3bf215546Sopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy
4bf215546Sopenharmony_ci# of this software and associated documentation files (the "Software"), to deal
5bf215546Sopenharmony_ci# in the Software without restriction, including without limitation the rights
6bf215546Sopenharmony_ci# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7bf215546Sopenharmony_ci# copies of the Software, and to permit persons to whom the Software is
8bf215546Sopenharmony_ci# furnished to do so, subject to the following conditions:
9bf215546Sopenharmony_ci
10bf215546Sopenharmony_ci# The above copyright notice and this permission notice shall be included in
11bf215546Sopenharmony_ci# all copies or substantial portions of the Software.
12bf215546Sopenharmony_ci
13bf215546Sopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14bf215546Sopenharmony_ci# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15bf215546Sopenharmony_ci# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16bf215546Sopenharmony_ci# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17bf215546Sopenharmony_ci# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18bf215546Sopenharmony_ci# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19bf215546Sopenharmony_ci# SOFTWARE.
20bf215546Sopenharmony_ci
21bf215546Sopenharmony_cipipe_loader_link_args = [ld_args_gc_sections, ld_args_build_id]
22bf215546Sopenharmony_cipipe_loader_link_deps = []
23bf215546Sopenharmony_cipipe_loader_link_with = [libgallium]
24bf215546Sopenharmony_cipipe_loader_comp_args = []
25bf215546Sopenharmony_cipipe_loader_incs = [
26bf215546Sopenharmony_ci  inc_include, inc_src, inc_util, inc_gallium, inc_gallium_drivers,
27bf215546Sopenharmony_ci  inc_gallium_winsys, inc_gallium_aux,
28bf215546Sopenharmony_ci]
29bf215546Sopenharmony_ci
30bf215546Sopenharmony_ciif (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled' or
31bf215546Sopenharmony_ci    with_gallium_xvmc or with_dri or with_gallium_radeonsi)
32bf215546Sopenharmony_ci  pipe_loader_link_with += libgalliumvl
33bf215546Sopenharmony_cielse
34bf215546Sopenharmony_ci  pipe_loader_link_with += libgalliumvl_stub
35bf215546Sopenharmony_ciendif
36bf215546Sopenharmony_ciif (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled' or
37bf215546Sopenharmony_ci    with_gallium_xvmc)
38bf215546Sopenharmony_ci  pipe_loader_link_with += libgalliumvlwinsys
39bf215546Sopenharmony_ciendif
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ciif with_ld_version_script
42bf215546Sopenharmony_ci  pipe_loader_link_args += [
43bf215546Sopenharmony_ci    '-Wl,--version-script', join_paths(meson.current_source_dir(), 'pipe.sym')
44bf215546Sopenharmony_ci  ]
45bf215546Sopenharmony_ci  pipe_loader_link_deps += files('pipe.sym')
46bf215546Sopenharmony_ciendif
47bf215546Sopenharmony_ci
48bf215546Sopenharmony_cipipe_loader_install_dir = join_paths(get_option('libdir'), 'gallium-pipe')
49bf215546Sopenharmony_ci
50bf215546Sopenharmony_ci_kmsro_targets = [
51bf215546Sopenharmony_ci   driver_kmsro, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv,
52bf215546Sopenharmony_ci   driver_panfrost, driver_lima,
53bf215546Sopenharmony_ci]
54bf215546Sopenharmony_ci
55bf215546Sopenharmony_ciif with_gallium_v3d
56bf215546Sopenharmony_ci   _kmsro_targets += [idep_xmlconfig, dep_expat]
57bf215546Sopenharmony_ciendif
58bf215546Sopenharmony_ci
59bf215546Sopenharmony_cipipe_loaders = [
60bf215546Sopenharmony_ci  [with_gallium_i915, 'i915', driver_i915, []],
61bf215546Sopenharmony_ci  [with_gallium_crocus, 'crocus', [driver_crocus, idep_xmlconfig], []],
62bf215546Sopenharmony_ci  [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], []],
63bf215546Sopenharmony_ci  [with_gallium_nouveau, 'nouveau', driver_nouveau, []],
64bf215546Sopenharmony_ci  [with_gallium_r300, 'r300', driver_r300, []],
65bf215546Sopenharmony_ci  [with_gallium_r600, 'r600', driver_r600, []],
66bf215546Sopenharmony_ci  [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi, idep_xmlconfig], []],
67bf215546Sopenharmony_ci  [with_gallium_freedreno, 'msm', driver_freedreno, []],
68bf215546Sopenharmony_ci  [with_gallium_kmsro, 'kmsro', _kmsro_targets, []],
69bf215546Sopenharmony_ci  [with_gallium_svga, 'vmwgfx', driver_svga, []],
70bf215546Sopenharmony_ci  [with_gallium_softpipe, 'swrast', driver_swrast, [libwsw, libws_null, libswdri, libswkmsdri]],
71bf215546Sopenharmony_ci]
72bf215546Sopenharmony_ci
73bf215546Sopenharmony_ciforeach x : pipe_loaders
74bf215546Sopenharmony_ci  if x[0]
75bf215546Sopenharmony_ci    shared_library(
76bf215546Sopenharmony_ci      'pipe_@0@'.format(x[1]),
77bf215546Sopenharmony_ci      'pipe_@0@.c'.format(x[1]),
78bf215546Sopenharmony_ci      c_args : [pipe_loader_comp_args, '-DPIPE_LOADER_DYNAMIC=1'],
79bf215546Sopenharmony_ci      cpp_args : [pipe_loader_comp_args],
80bf215546Sopenharmony_ci      gnu_symbol_visibility : 'hidden',
81bf215546Sopenharmony_ci      link_args : pipe_loader_link_args,
82bf215546Sopenharmony_ci      link_depends : pipe_loader_link_deps,
83bf215546Sopenharmony_ci      include_directories : pipe_loader_incs,
84bf215546Sopenharmony_ci      link_with : [pipe_loader_link_with, x[3]],
85bf215546Sopenharmony_ci      dependencies : [idep_mesautil, idep_nir, dep_thread, x[2]],
86bf215546Sopenharmony_ci      name_prefix : '',
87bf215546Sopenharmony_ci      install : true,
88bf215546Sopenharmony_ci      install_dir : pipe_loader_install_dir,
89bf215546Sopenharmony_ci    )
90bf215546Sopenharmony_ci  endif
91bf215546Sopenharmony_ciendforeach
92