# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-# TODO:
-#subdir('windows')
+inc_glx = include_directories('.')
+
+subdir('apple')
+if with_dri_platform == 'windows'
+ subdir('windows')
+endif
files_libglx = files(
'clientattrib.c',
)
extra_libs_libglx = []
+extra_deps_libgl = []
+extra_ld_args_libgl = []
if with_dri
files_libglx += files(
files_libglx += files('dri3_glx.c', 'dri3_priv.h')
endif
-if with_appledri
+if with_dri_platform == 'apple'
files_libglx += files('applegl_glx.c')
-elif with_windowsdri
+ extra_libs_libglx += libappleglx
+elif with_dri_platform == 'windows'
files_libglx += files('driwindows_glx.c')
- # TODO
- #extra_libs_libglx += [
- #libwindowsdri,
- #libwindowsglx,
- #]
+ extra_libs_libglx += [
+ libwindowsdri,
+ libwindowsglx,
+ ]
+ extra_deps_libgl = [
+ meson.get_compiler('c').find_library('gdi32'),
+ meson.get_compiler('c').find_library('opengl32')
+ ]
+ extra_ld_args_libgl = '-Wl,--disable-stdcall-fixup'
endif
-dri_driver_dir = join_paths(get_option('prefix'), get_option('libdir'), 'dri')
if not with_glvnd
gl_lib_name = 'GL'
gl_lib_version = '1.2.0'
else
gl_lib_name = 'GLX_mesa'
- gl_lib_version = '0'
+ gl_lib_version = '0.0.0'
files_libglx += files(
'g_glxglvnddispatchfuncs.c',
'g_glxglvnddispatchindices.h',
endif
gl_lib_cargs = [
- '-D_REENTRANT', '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
+ '-D_REENTRANT',
]
-if dep_xf86vm != [] and dep_xf86vm.found()
- gl_lib_cargs += '-DHAVE_XF86VIDMODE'
-endif
-
libglx = static_library(
'glx',
[files_libglx, glx_generated],
- include_directories : [
- inc_common, inc_glapi, inc_loader,
- include_directories('../../include/GL/internal'),
+ include_directories : [inc_common, inc_glapi, inc_loader, inc_gl_internal],
+ c_args : [
+ c_vis_args, gl_lib_cargs,
+ '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]),
+ ],
+ link_with : [
+ libloader, libloader_dri3_helper, libmesa_util, libxmlconfig,
+ extra_libs_libglx,
],
- c_args : [c_vis_args, gl_lib_cargs,
- '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0])],
- link_with : [libloader, libloader_dri3_helper, libmesa_util, libxmlconfig],
dependencies : [dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_glvnd],
- build_by_default : false,
)
-# workaround for bug #2180
-dummy_c = custom_target(
- 'dummy_c',
- output : 'dummy.c',
- command : [prog_touch, '@OUTPUT@'],
+libgl = shared_library(
+ gl_lib_name,
+ [],
+ include_directories : [inc_common, inc_glapi, inc_loader, inc_gl_internal],
+ link_with : [libglapi_static, libglapi],
+ link_whole : libglx,
+ link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl],
+ dependencies : [
+ dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb,
+ dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage, dep_xxf86vm,
+ extra_deps_libgl,
+ ],
+ version : gl_lib_version,
+ install : true,
)
-if with_glx == 'dri'
- libgl = shared_library(
- gl_lib_name,
- dummy_c, # workaround for bug #2180
- include_directories : [
- inc_common, inc_glapi, inc_loader,
- include_directories('../../include/GL/internal'),
- ],
- link_with : [libglapi_static, libglapi],
- link_whole : libglx,
- link_args : [ld_args_bsymbolic, ld_args_gc_sections],
- dependencies : [dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11,
- dep_xcb_dri2, dep_xcb_dri3],
- version : gl_lib_version,
- install : true,
- )
-
- gl_priv_reqs = [
- 'x11', 'xext', 'xdamage >= 1.1', 'xfixes', 'x11-xcb', 'xcb',
- 'xcb-glx >= 1.8.1', 'libdrm >= 2.4.75',
- ]
- if dep_xf86vm.found()
- gl_priv_reqs += 'xf86vm'
- endif
- if with_dri_platform == 'drm'
- gl_priv_reqs += 'xcb-dri2 >= 1.8'
- endif
-
- gl_priv_libs = []
- if dep_thread.found()
- gl_priv_libs += ['-lpthread', '-pthread']
- endif
- if dep_m.found()
- gl_priv_libs += '-lm'
- endif
- if dep_dl.found()
- gl_priv_libs += '-ldl'
- endif
-
- pkg.generate(
- name : 'gl',
- filebase : 'gl',
- description : 'Mesa OpenGL Library',
- version : meson.project_version(),
- libraries : libgl,
- libraries_private : gl_priv_libs,
- requires_private : gl_priv_reqs,
- variables : ['glx_tls=yes'],
- )
-endif
-
if with_tests
subdir('tests')
endif