1 # Copyright © 2017 Intel Corporation
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:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
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
46 'indirect_texture_compression.c',
47 'indirect_transpose_matrix.c',
48 'indirect_vertex_array.c',
49 'indirect_vertex_array.h',
50 'indirect_vertex_array_priv.h',
51 'indirect_vertex_program.c',
52 'indirect_window_pos.c',
65 extra_libs_libglx = []
68 files_libglx += files(
71 'dri_common_query_renderer.c',
72 'dri_common_interop.c',
80 if with_dri and with_dri_platform == 'drm' and dep_libdrm.found()
81 files_libglx += files(
95 files_libglx += files('dri3_glx.c', 'dri3_priv.h')
99 files_libglx += files('applegl_glx.c')
101 files_libglx += files('driwindows_glx.c')
103 #extra_libs_libglx += [
109 dri_driver_dir = join_paths(get_option('prefix'), dri_drivers_path)
112 gl_lib_version = '1.2.0'
114 gl_lib_name = 'GLX_mesa'
116 files_libglx += files(
117 'g_glxglvnddispatchfuncs.c',
118 'g_glxglvnddispatchindices.h',
121 'glxglvnddispatchfuncs.h',
126 '-D_REENTRANT', '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
129 if dep_xf86vm != [] and dep_xf86vm.found()
130 gl_lib_cargs += '-DHAVE_XF86VIDMODE'
133 libglx = static_library(
135 [files_libglx, glx_generated],
136 include_directories : [
137 inc_common, inc_glapi, inc_loader,
138 include_directories('../../include/GL/internal'),
140 c_args : [c_vis_args, gl_lib_cargs,
141 '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0])],
142 link_with : [libloader, libloader_dri3_helper, libmesa_util, libxmlconfig],
143 dependencies : [dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_glvnd],
144 build_by_default : false,
147 # workaround for bug #2180
148 dummy_c = custom_target(
151 command : [prog_touch, '@OUTPUT@'],
155 libgl = shared_library(
157 dummy_c, # workaround for bug #2180
158 include_directories : [
159 inc_common, inc_glapi, inc_loader,
160 include_directories('../../include/GL/internal'),
162 link_with : [libglapi_static, libglapi],
164 link_args : [ld_args_bsymbolic, ld_args_gc_sections],
165 dependencies : [dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11,
166 dep_xcb_dri2, dep_xcb_dri3],
167 version : gl_lib_version,
172 'x11', 'xext', 'xdamage >= 1.1', 'xfixes', 'x11-xcb', 'xcb',
173 'xcb-glx >= 1.8.1', 'libdrm >= 2.4.75',
175 if dep_xf86vm.found()
176 gl_priv_reqs += 'xf86vm'
178 if with_dri_platform == 'drm'
179 gl_priv_reqs += 'xcb-dri2 >= 1.8'
183 if dep_thread.found()
184 gl_priv_libs += ['-lpthread', '-pthread']
187 gl_priv_libs += '-lm'
190 gl_priv_libs += '-ldl'
196 description : 'Mesa OpenGL Library',
197 version : meson.project_version(),
199 libraries_private : gl_priv_libs,
200 requires_private : gl_priv_reqs,
201 variables : ['glx_tls=yes'],