freedreno/a6xx: Program VFD_DEST_CNTL from program stateobj
[mesa.git] / src / glx / meson.build
1 # Copyright © 2017-2019 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 inc_glx = include_directories('.')
22
23 subdir('apple')
24 if with_dri_platform == 'windows'
25 subdir('windows')
26 endif
27
28 files_libglx = files(
29 'clientattrib.c',
30 'clientinfo.c',
31 'compsize.c',
32 'create_context.c',
33 'dri_common.c',
34 'dri_common.h',
35 'dri_common_query_renderer.c',
36 'dri_common_interop.c',
37 'drisw_glx.c',
38 'drisw_priv.h',
39 'eval.c',
40 'glxclient.h',
41 'glxcmds.c',
42 'glxconfig.c',
43 'glxconfig.h',
44 'glxcurrent.c',
45 'glx_error.c',
46 'glx_error.h',
47 'glxext.c',
48 'glxextensions.c',
49 'glxextensions.h',
50 'glxhash.c',
51 'glxhash.h',
52 'glx_pbuffer.c',
53 'glx_query.c',
54 'indirect_glx.c',
55 'indirect_init.h',
56 'indirect_texture_compression.c',
57 'indirect_transpose_matrix.c',
58 'indirect_vertex_array.c',
59 'indirect_vertex_array.h',
60 'indirect_vertex_array_priv.h',
61 'indirect_vertex_program.c',
62 'indirect_window_pos.c',
63 'packrender.h',
64 'packsingle.h',
65 'pixel.c',
66 'pixelstore.c',
67 'query_renderer.c',
68 'render2.c',
69 'renderpix.c',
70 'single2.c',
71 'singlepix.c',
72 'vertarr.c',
73 'xfont.c',
74 )
75
76 extra_libs_libglx = []
77 extra_deps_libgl = []
78 extra_ld_args_libgl = []
79
80 # dri2
81 if with_dri_platform == 'drm' and dep_libdrm.found()
82 files_libglx += files(
83 'dri2.c',
84 'dri2_glx.c',
85 'dri2.h',
86 'dri2_priv.h',
87 'dri_glx.c',
88 'dri_sarea.h',
89 'XF86dri.c',
90 'xf86dri.h',
91 'xf86dristr.h',
92 )
93 endif
94
95 if with_dri3
96 files_libglx += files('dri3_glx.c', 'dri3_priv.h')
97 endif
98
99 if with_dri_platform == 'apple'
100 files_libglx += files('applegl_glx.c')
101 extra_libs_libglx += libappleglx
102 elif with_dri_platform == 'windows'
103 files_libglx += files('driwindows_glx.c')
104 extra_libs_libglx += [
105 libwindowsdri,
106 libwindowsglx,
107 ]
108 extra_deps_libgl = [
109 meson.get_compiler('c').find_library('gdi32'),
110 meson.get_compiler('c').find_library('opengl32')
111 ]
112 extra_ld_args_libgl = '-Wl,--disable-stdcall-fixup'
113 endif
114
115 if not with_glvnd
116 gl_lib_name = 'GL'
117 gl_lib_version = '1.2.0'
118 else
119 gl_lib_name = 'GLX_mesa'
120 gl_lib_version = '0.0.0'
121 files_libglx += files(
122 'g_glxglvnddispatchfuncs.c',
123 'g_glxglvnddispatchindices.h',
124 'glxglvnd.c',
125 'glxglvnd.h',
126 'glxglvnddispatchfuncs.h',
127 )
128 endif
129
130 gl_lib_cargs = [
131 '-D_REENTRANT',
132 ]
133
134 libglx = static_library(
135 'glx',
136 [files_libglx, glx_generated],
137 include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glapi, inc_loader],
138 c_args : [
139 c_vis_args, gl_lib_cargs,
140 '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]),
141 ],
142 link_with : [
143 libloader, libloader_dri3_helper,
144 extra_libs_libglx,
145 ],
146 dependencies : [
147 idep_mesautil, idep_xmlconfig,
148 dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_glvnd,
149 ],
150 )
151
152 libgl = shared_library(
153 gl_lib_name,
154 [],
155 link_with : [libglapi_static, libglapi],
156 link_whole : libglx,
157 link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl],
158 dependencies : [
159 dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb,
160 dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage, dep_xxf86vm,
161 extra_deps_libgl,
162 ],
163 version : gl_lib_version,
164 install : true,
165 )
166
167 if with_tests
168 subdir('tests')
169 endif