blob: c591b75d03794292309a33c563272c43db699488 [file] [log] [blame]
Dylan Bakerb154b442017-09-30 14:04:28 -07001# Copyright © 2017 Dylan Baker
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
25gallium_dri_c_args = [
26 '-DGALLIUM_DDEBUG',
27 '-DGALLIUM_NOOP',
28 '-DGALLIUM_RBUG',
29 '-DGALLIUME_TRACE',
30]
31gallium_dri_ld_args = []
32gallium_dri_link_with = []
33gallium_dri_depends = []
34gallium_dri_link_depends = []
35gallium_dri_drivers = []
36gallium_dri_sources = []
37
38if with_ld_version_script
39 gallium_dri_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'dri.sym')]
40 gallium_dri_link_depends += files('dri.sym')
41endif
42if with_ld_dynamic_list
43 gallium_dri_ld_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri-vdpau.dyn')]
44 gallium_dri_link_depends += files('../dri-vdpau.dyn')
45endif
46
47if with_dri
48 gallium_dri_link_with += libswdri
49endif
50if with_gallium_drisw_kms
51 gallium_dri_link_with += libswkmsdri
52endif
53
Eric Anholt1918c9b2017-10-12 18:39:08 -070054if with_gallium_pl111
55 gallium_dri_c_args += '-DGALLIUM_PL111'
56 gallium_dri_link_with += [libpl111winsys]
57 gallium_dri_drivers += 'pl111_dri.so'
58endif
Dylan Bakerb154b442017-09-30 14:04:28 -070059if with_gallium_radeonsi
60 gallium_dri_c_args += '-DGALLIUM_RADEONSI'
61 gallium_dri_link_with += [
Eric Anholt1ae80182017-10-12 13:53:12 -070062 libradeonsi, libradeonwinsys, libamdgpuwinsys, libradeon,
Dylan Bakerb154b442017-09-30 14:04:28 -070063 libamd_common,
64 ]
65 gallium_dri_drivers += 'radeonsi_dri.so'
66endif
Dylan Baker813b4b02017-10-09 14:59:35 -070067if with_gallium_nouveau
68 gallium_dri_c_args += '-DGALLIUM_NOUVEAU'
69 gallium_dri_link_with += [libnouveauwinsys, libnouveau]
70 gallium_dri_drivers += 'nouveau_dri.so'
71endif
Rob Clark4aa69cc2017-10-14 10:08:50 -040072if with_gallium_freedreno
73 gallium_dri_c_args += '-DGALLIUM_FREEDRENO'
74 gallium_dri_link_with += [libfreedrenowinsys, libfreedreno]
75 gallium_dri_drivers += 'msm_dri.so'
76 gallium_dri_drivers += 'kgsl_dri.so'
77endif
Dylan Bakerde24d612017-10-10 14:27:19 -070078if with_gallium_softpipe
79 gallium_dri_c_args += '-DGALLIUM_SOFTPIPE'
80 gallium_dri_link_with += libsoftpipe
81 gallium_dri_drivers += 'swrast_dri.so'
82 if with_gallium_drisw_kms
83 gallium_dri_drivers += 'kms_swrast_dri.so'
84 endif
Dylan Baker6a9ad202017-10-10 14:56:39 -070085 if with_llvm
86 gallium_dri_c_args += '-DGALLIUM_LLVMPIPE'
87 gallium_dri_link_with += libllvmpipe
88 endif
Dylan Bakerde24d612017-10-10 14:27:19 -070089endif
Eric Anholt1ae80182017-10-12 13:53:12 -070090if with_gallium_vc4
91 gallium_dri_c_args += '-DGALLIUM_VC4'
Eric Anholt4f3e3802017-10-12 18:40:16 -070092 gallium_dri_link_with += [libvc4, libvc4winsys]
Eric Anholt1ae80182017-10-12 13:53:12 -070093 gallium_dri_drivers += 'vc4_dri.so'
94endif
Eric Anholt4f3e3802017-10-12 18:40:16 -070095if with_gallium_vc5
96 gallium_dri_c_args += '-DGALLIUM_VC5'
97 gallium_dri_link_with += [libvc5, libvc5winsys, libbroadcom_vc5]
98 gallium_dri_drivers += 'vc5_dri.so'
99endif
Dylan Baker51558a12017-10-20 15:45:22 -0700100if with_gallium_etnaviv
101 gallium_dri_c_args += '-DGALLIUM_ETNAVIV'
102 gallium_dri_link_with += [libetnaviv, libetnavivdrm]
103 gallium_dri_drivers += 'etnaviv_dri.so'
104endif
Dylan Bakerd4567ef2017-10-20 15:57:15 -0700105if with_gallium_imx
106 gallium_dri_c_args += '-DGALLIUM_IMX'
107 gallium_dri_link_with += libimxdrm
108 gallium_dri_drivers += 'imx-drm_dri.so'
109endif
Eric Anholt1ae80182017-10-12 13:53:12 -0700110
Eric Anholt4f3e3802017-10-12 18:40:16 -0700111if with_gallium_vc4 or with_gallium_vc5
112 gallium_dri_link_with += libbroadcom_cle
113endif
114
115if with_gallium_vc4 or with_gallium_vc5 or with_gallium_radeonsi
Eric Anholt1ae80182017-10-12 13:53:12 -0700116 gallium_dri_link_with += libnir
117endif
Dylan Bakerb154b442017-09-30 14:04:28 -0700118
119libgallium_dri = shared_library(
120 'gallium_dri',
121 [files('target.c'), gallium_dri_sources],
122 include_directories : [
123 inc_common, inc_util, inc_dri_common, inc_gallium_drivers,
124 inc_gallium_winsys, include_directories('../../state_trackers/dri'),
125 ],
126 c_args : [c_vis_args, gallium_dri_c_args],
127 cpp_args : [cpp_vis_args],
128 link_args : [ld_args_gc_sections, gallium_dri_ld_args],
129 link_depends : gallium_dri_link_depends,
130 link_with : [
131 libmesa_gallium, libdricommon, libmegadriver_stub, libdri, libgalliumvl,
132 libgallium, libddebug, libnoop, librbug, libtrace, libglapi,
133 libpipe_loader_static, libws_null, libwsw, gallium_dri_link_with,
134 ],
135 dependencies : [
136 gallium_dri_depends, dep_selinux, dep_expat, dep_libdrm, dep_llvm,
Eric Anholt9c9fd8f2017-11-08 14:00:51 -0800137 dep_thread,
Dylan Bakerb154b442017-09-30 14:04:28 -0700138 ],
139)
140
141meson.add_install_script(
142 join_paths(meson.source_root(), 'bin/install_megadrivers.py'),
143 libgallium_dri.full_path(),
144 dri_drivers_path,
145 gallium_dri_drivers,
146)