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 21inc_glx = include_directories('.') 22 23subdir('apple') 24if with_dri_platform == 'windows' 25 subdir('windows') 26endif 27 28files_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 76extra_libs_libglx = [] 77extra_deps_libgl = [] 78extra_ld_args_libgl = [] 79 80# dri2 81if 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 ) 93endif 94 95if with_dri3 96 files_libglx += files('dri3_glx.c', 'dri3_priv.h') 97endif 98 99if with_dri_platform == 'apple' 100 files_libglx += files('applegl_glx.c') 101 extra_libs_libglx += libappleglx 102elif 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' 113endif 114 115if not with_glvnd 116 gl_lib_name = 'GL' 117 gl_lib_version = '1.2.0' 118else 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 ) 128endif 129 130gl_lib_cargs = [ 131 '-D_REENTRANT', 132] 133 134libglx = 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 gl_lib_cargs, 140 '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]), 141 ], 142 gnu_symbol_visibility : 'hidden', 143 link_with : [ 144 libloader, libloader_dri3_helper, 145 extra_libs_libglx, 146 ], 147 dependencies : [ 148 idep_mesautil, idep_xmlconfig, 149 dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_glvnd, 150 ], 151) 152 153libgl = shared_library( 154 gl_lib_name, 155 [], 156 link_with : [libglapi_static, libglapi], 157 link_whole : libglx, 158 link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl], 159 dependencies : [ 160 dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb, 161 dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage, dep_xxf86vm, 162 dep_xcb_shm, extra_deps_libgl, 163 ], 164 version : gl_lib_version, 165 install : true, 166) 167 168if with_tests 169 subdir('tests') 170endif 171