GL/ContextEGL: Fix compiling with both DRM/KMS and X11 enabled

This commit is contained in:
Connor McLaughlin 2021-02-01 01:45:30 +10:00
parent dac9cdd04c
commit cbdf722dd6
2 changed files with 9 additions and 4 deletions

View file

@ -162,6 +162,11 @@ if(USE_EGL)
gl/context_egl_x11.cpp gl/context_egl_x11.cpp
gl/context_egl_x11.h gl/context_egl_x11.h
) )
# We set EGL_NO_X11 because otherwise X comes in with its macros and breaks
# a bunch of files from compiling, if we include the EGL headers. This just
# makes the data types opaque, we can still use it with X11 if needed.
target_compile_definitions(common PRIVATE "-DEGL_NO_X11=1")
endif() endif()
if(ANDROID AND USE_EGL) if(ANDROID AND USE_EGL)
target_sources(common PRIVATE target_sources(common PRIVATE

View file

@ -16,16 +16,16 @@ Log_SetChannel(GL::Context);
#endif #endif
#ifdef USE_EGL #ifdef USE_EGL
#if defined(USE_X11) || defined(USE_WAYLAND) || defined(USE_GBM) #if defined(USE_WAYLAND) || defined(USE_GBM) || defined(USE_X11)
#if defined(USE_X11)
#include "context_egl_x11.h"
#endif
#if defined(USE_WAYLAND) #if defined(USE_WAYLAND)
#include "context_egl_wayland.h" #include "context_egl_wayland.h"
#endif #endif
#if defined(USE_GBM) #if defined(USE_GBM)
#include "context_egl_gbm.h" #include "context_egl_gbm.h"
#endif #endif
#if defined(USE_X11)
#include "context_egl_x11.h"
#endif
#elif defined(ANDROID) #elif defined(ANDROID)
#include "context_egl_android.h" #include "context_egl_android.h"
#else #else