Commit c7a739bef4c20b280523e3362170201ccb4a2960

Sam Lantinga 2020-03-02T15:24:10

Fixed bug 4643 - Append EGL CFLAGS in CheckOpenGLESX11 Danilo Spinella EGL need -DMESA_EGL_NO_X11_HEADERS in systems without X11 installed. Make CMake checks import EGL CFLAGS. Relevant bug: https://bugzilla.libsdl.org/show_bug.cgi?id=4243

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 3b7f821..ee8421f 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -757,8 +757,10 @@ macro(CheckOpenGLX11)
 endmacro()
 
 # Requires:
-# - nada
+# - PkgCheckModules
 macro(CheckOpenGLESX11)
+  pkg_check_modules(EGL egl)
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${EGL_CFLAGS}")
   if(VIDEO_OPENGLES)
     check_c_source_compiles("
         #define EGL_API_FB