Merge branch 'fix-x11-config-option' into 'master'

Fix the option to disable X11 in meson

See merge request glvnd/libglvnd!258
This commit is contained in:
Kyle Brenneman 2021-10-28 15:28:42 +00:00
commit 922b85a94a
5 changed files with 14 additions and 9 deletions

View File

@ -203,7 +203,7 @@ AX_PTHREAD()
if test "x$enable_x11" = "xyes" ; then
PKG_CHECK_MODULES([X11], [x11])
AC_DEFINE([USE_X11], 1,
AC_DEFINE([ENABLE_EGL_X11], 1,
[Define to 1 if X11 support is enabled.])
fi
if test "x$enable_glx" = "xyes" ; then

View File

@ -87,10 +87,15 @@ endif
dep_dl = cc.find_library('dl', required : false)
dep_m = cc.find_library('m', required : false)
dep_threads = dependency('threads')
dep_x11 = dependency('x11', required : get_option('x11'))
if get_option('x11').disabled()
dep_x11 = dependency('', required : false)
else
dep_x11 = dependency('x11', required : get_option('x11'))
endif
dep_x11_headers = dep_x11.partial_dependency(compile_args : true, includes : true)
if dep_x11.found()
add_project_arguments('-DUSE_X11', language : ['c'])
add_project_arguments('-DENABLE_EGL_X11', language : ['c'])
endif
dep_xext = dep_null

View File

@ -32,7 +32,7 @@
#include <unistd.h>
#include <sys/mman.h>
#if defined(USE_X11)
#if defined(ENABLE_EGL_X11)
#include <X11/Xlib.h>
#endif
@ -176,7 +176,7 @@ static EGLBoolean IsGbmDisplay(void *native_display)
static EGLBoolean IsX11Display(void *dpy)
{
#if defined(USE_X11)
#if defined(ENABLE_EGL_X11)
void *alloc;
void *handle;
void *XAllocID = NULL;
@ -193,9 +193,9 @@ static EGLBoolean IsX11Display(void *dpy)
}
return (XAllocID != NULL && XAllocID == alloc);
#else // defined(USE_X11)
#else // defined(ENABLE_EGL_X11)
return EGL_FALSE;
#endif // defined(USE_X11)
#endif // defined(ENABLE_EGL_X11)
}
static EGLBoolean IsWaylandDisplay(void *native_display)

View File

@ -50,7 +50,7 @@ if get_option('egl')
c_args : ['-DDUMMY_VENDOR_NAME="dummy@0@"'.format(v)],
include_directories : [inc_include],
link_with: [libpatchentrypoints],
dependencies : [idep_glvnd_pthread, dep_x11_headers],
dependencies : [idep_glvnd_pthread],
version : '0',
)
endforeach

View File

@ -208,7 +208,7 @@ if get_option('egl')
['test@0@.c'.format(t[0]), 'egl_test_utils.c'],
include_directories : [inc_include],
link_with : [libEGL, t[1]],
dependencies : [t[2], dep_x11_headers],
dependencies : [t[2]],
),
env : env_egl,
suite : ['egl'],