Separate EGL / GL ES detection in CMake
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 14fb327..5666f52 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -563,25 +563,29 @@ macro(CheckOpenGLESX11)
if(VIDEO_OPENGLES)
check_c_source_compiles("
#include <EGL/egl.h>
- int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES)
- if(HAVE_VIDEO_OPENGLES)
- check_c_source_compiles("
- #include <GLES/gl.h>
- #include <GLES/glext.h>
- int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V1)
- if(HAVE_VIDEO_OPENGLES_V1)
+ int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL)
+ if(HAVE_VIDEO_OPENGL_EGL)
+ set(SDL_VIDEO_OPENGL_EGL 1)
+ endif(HAVE_VIDEO_OPENGL_EGL)
+ check_c_source_compiles("
+ #include <GLES/gl.h>
+ #include <GLES/glext.h>
+ int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V1)
+ if(HAVE_VIDEO_OPENGLES_V1)
+ set(HAVE_VIDEO_OPENGLES TRUE)
set(SDL_VIDEO_OPENGL_ES 1)
set(SDL_VIDEO_RENDER_OGL_ES 1)
- endif(HAVE_VIDEO_OPENGLES_V1)
- check_c_source_compiles("
- #include <GLES2/gl2.h>
- #include <GLES2/gl2ext.h>
- int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V2)
- if(HAVE_VIDEO_OPENGLES_V2)
+ endif(HAVE_VIDEO_OPENGLES_V1)
+ check_c_source_compiles("
+ #include <GLES2/gl2.h>
+ #include <GLES2/gl2ext.h>
+ int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V2)
+ if(HAVE_VIDEO_OPENGLES_V2)
+ set(HAVE_VIDEO_OPENGLES TRUE)
set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
- endif(HAVE_VIDEO_OPENGLES_V2)
- endif(HAVE_VIDEO_OPENGLES)
+ endif(HAVE_VIDEO_OPENGLES_V2)
+
endif(VIDEO_OPENGLES)
endmacro(CheckOpenGLESX11)
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index f9a9ab9..66107e4 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -293,6 +293,7 @@
#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@
#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@
+#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@
#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@
#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@