045eb4174a71a789b5f472f546cc1e66405d197d
[mesa.git] / src / gallium / targets / pipe-loader / meson.build
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 pipe_loader_link_args = [ld_args_gc_sections]
22 pipe_loader_link_deps = []
23 pipe_loader_link_with = [libgallium, libnir]
24 pipe_loader_comp_args = []
25 pipe_loader_incs = [
26 inc_include, inc_src, inc_util, inc_gallium, inc_gallium_drivers,
27 inc_gallium_winsys, inc_gallium_aux,
28 ]
29
30 if (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled' or
31 with_gallium_xvmc or with_dri)
32 pipe_loader_link_with += libgalliumvl
33 else
34 pipe_loader_link_with += libgalliumvl_stub
35 endif
36 if (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled' or
37 with_gallium_xvmc)
38 pipe_loader_link_with += libgalliumvlwinsys
39 endif
40
41 if with_ld_version_script
42 pipe_loader_link_args += [
43 '-Wl,--version-script', join_paths(meson.current_source_dir(), 'pipe.sym')
44 ]
45 pipe_loader_link_deps += files('pipe.sym')
46 endif
47
48 pipe_loader_install_dir = join_paths(get_option('libdir'), 'gallium-pipe')
49
50 pipe_loaders = [
51 [with_gallium_i915, 'i915', driver_i915, [], []],
52 [with_gallium_nouveau, 'nouveau', driver_nouveau, [], []],
53 [with_gallium_r300, 'r300', driver_r300, [], []],
54 [with_gallium_r600, 'r600', driver_r600, [], []],
55 [with_gallium_radeonsi, 'radeonsi', driver_radeonsi, [libxmlconfig], [xmlpool_options_h]],
56 [with_gallium_freedreno, 'msm', driver_freedreno, [], []],
57 [with_gallium_svga, 'vmwgfx', driver_svga, [], []],
58 [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null], []],
59 ]
60
61 foreach x : pipe_loaders
62 if x[0]
63 shared_library(
64 'pipe_@0@'.format(x[1]),
65 ['pipe_@0@.c'.format(x[1]), x[4]],
66 c_args : [pipe_loader_comp_args, c_vis_args],
67 cpp_args : [pipe_loader_comp_args, cpp_vis_args],
68 link_args : pipe_loader_link_args,
69 link_depends : pipe_loader_link_deps,
70 include_directories : pipe_loader_incs,
71 link_with : [pipe_loader_link_with, x[3]],
72 dependencies : [idep_mesautil, dep_thread, x[2]],
73 name_prefix : '',
74 install : true,
75 install_dir : pipe_loader_install_dir,
76 )
77 endif
78 endforeach