CMake: Link against OpenGL when using EGL but not GLES2

At least for Linux armv7hl this seems to be necessary, otherwise build
fails with:

/usr/bin/ld: lib/libnative.a(GLQueueRunner.cpp.o): undefined reference to symbol 'glStencilOp'
This commit is contained in:
Rémi Verschelde 2018-11-06 14:31:44 +01:00
parent 67d6e3d384
commit ea2025c291

View File

@ -182,6 +182,10 @@ if(NOT OPENGL_LIBRARIES AND USING_GLES2)
set(OPENGL_LIBRARIES GLESv2 EGL)
endif()
if(NOT OPENGL_LIBRARIES)
find_package(OpenGL REQUIRED)
endif()
if(USING_EGL)
if(NOT EGL_LIBRARIES)
set(EGL_LIBRARIES EGL)
@ -189,10 +193,6 @@ if(USING_EGL)
set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} ${EGL_LIBRARIES})
endif()
if(NOT OPENGL_LIBRARIES)
find_package(OpenGL REQUIRED)
endif()
find_package(SDL2)
include(FindThreads)