CMake: OpenGL ES support doesn't build
Hi,
Thanks for Solarus-engine :)
I'm trying to build Solarus with OpenGL ES support (i.e without OpenGL (GLX) support).
Here is the build log:
-- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR)
CMake Error at cmake/AddDependencies.cmake:13 (find_package):
By not providing "FindOpenGLES2.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"OpenGLES2", but CMake did not find one.
Could not find a package configuration file provided by "OpenGLES2" with
any of the following names:
OpenGLES2Config.cmake
opengles2-config.cmake
Add the installation prefix of "OpenGLES2" to CMAKE_PREFIX_PATH or set
"OpenGLES2_DIR" to a directory containing one of the above files. If
"OpenGLES2" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:7 (include)
I found an example of FindOpenGLES2.cmake: https://raw.githubusercontent.com/freeminer/freeminer/master/cmake/Modules/FindOpenGLES2.cmake
It would be great if Solarus provide FindOpenGLES2.cmake.
Then, the build start but fail with the following error:
/home/naourr/buildroot/test/solarus/build/solarus-1.6.0/src/graphics/glrenderer /GlRenderer.cpp:34:1: error: expected initializer before ‘MessageCallback’
MessageCallback( GLenum /*source*/,
^~~~~~~~~~~~~~~
[ 55%] Building CXX object CMakeFiles/solarus.dir/src/hero/BowState.cpp.o
/home/naourr/buildroot/test/solarus/build/solarus-1.6.0/src/graphics/glrenderer/GlShader.cpp: In static member function ‘static bool Solarus::GlShader::initialize()’:
/home/naourr/buildroot/test/solarus/build/solarus-1.6.0/src/graphics/glrenderer /GlShader.cpp:54:22: error: ‘GL_MAJOR_VERSION’ was not declared in this scope
ctx->glGetIntegerv(GL_MAJOR_VERSION,&major);
^~~~~~~~~~~~~~~~
/home/naourr/buildroot/test/solarus/build/solarus-1.6.0/src/graphics/glrenderer /GlShader.cpp:54:22: note: suggested alternative: ‘LUAJIT_VERSION’
ctx->glGetIntegerv(GL_MAJOR_VERSION,&major);
^~~~~~~~~~~~~~~~
LUAJIT_VERSION
/home/naourr/buildroot/test/solarus/build/solarus-1.6.0/src/graphics/glrenderer /GlShader.cpp:55:22: error: ‘GL_MINOR_VERSION’ was not declared in this scope
ctx->glGetIntegerv(GL_MINOR_VERSION,&minor);
^~~~~~~~~~~~~~~~
/home/naourr/buildroot/test/solarus/build/solarus-1.6.0/src/graphics/glrenderer/GlShader.cpp:55:22: note: suggested alternative: ‘GLM_VERSION’
ctx->glGetIntegerv(GL_MINOR_VERSION,&minor);
^~~~~~~~~~~~~~~~
GLM_VERSION
[ 56%] Building CXX object CMakeFiles/solarus.dir/src/hero/CarryingState.cpp.o
So the new OpenGL ES support doesn't seems to build/work as expected :-/
Best regards, Romain
PS: Solarus-engine 1.5.3 is available in Buildroot since the version 2018.02: https://git.buildroot.net/buildroot/tree/package/solarus?h=2018.02.x