diff --git a/external/OpenGL/CMakeLists.txt b/external/OpenGL/CMakeLists.txt index 9a8a35ef7..2ce01e6a4 100644 --- a/external/OpenGL/CMakeLists.txt +++ b/external/OpenGL/CMakeLists.txt @@ -26,9 +26,8 @@ if(NOT TARGET_GLES) add_subdirectory(GL) else() add_subdirectory(KHR) - if(TARGET_GLES2) - add_subdirectory(GLES2) - else() + add_subdirectory(GLES2) + if(NOT TARGET_GLES2) add_subdirectory(GLES3) endif() endif() diff --git a/external/OpenGL/GLES2/CMakeLists.txt b/external/OpenGL/GLES2/CMakeLists.txt index 59c230f13..2a1a501ca 100644 --- a/external/OpenGL/GLES2/CMakeLists.txt +++ b/external/OpenGL/GLES2/CMakeLists.txt @@ -25,8 +25,9 @@ set(MagnumOpenGL_HEADERS gl2ext.h) -# NaCl has its own gl2.h, this one causes linker issues -if(NOT CORRADE_TARGET_NACL) +# We need gl2ext.h also for ES3 (but not the others). NaCl has its own gl2.h, +# this one causes linker issues +if(TARGET_GLES2 AND NOT CORRADE_TARGET_NACL) set(MagnumOpenGL_HEADERS ${MagnumOpenGL_HEADERS} gl2platform.h gl2.h)