Skip to content

Commit 49f1006

Browse files
osjcSmallJoker
authored andcommitted
Fix breakage of non-GLES2 setups (#8774)
The commit 526a9e4 breaks the non-GLES2 setups because the code that is intended to handle that is behind "elseif()" which is interpreted as "elseif(false)" and thus the code never gets executed. Fix that by changing the offending line to else(). Additionally, to avoid breaking the server only build (which shall not have a dependency on GL/GLU/GLES at all), enclose the entire block code in if(BUILD_CLIENT).
1 parent 120155f commit 49f1006

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/CMakeLists.txt

+11-9
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,17 @@ endif()
104104

105105
option(ENABLE_GLES "Use OpenGL ES instead of OpenGL" FALSE)
106106
mark_as_advanced(ENABLE_GLES)
107-
if(ENABLE_GLES)
108-
find_package(OpenGLES2 REQUIRED)
109-
elseif()
110-
if(NOT WIN32) # Unix probably
111-
set(OPENGL_GL_PREFERENCE "LEGACY" CACHE STRING
112-
"See CMake Policy CMP0072 for reference. GLVND is broken on some nvidia setups")
113-
set(OpenGL_GL_PREFERENCE ${OPENGL_GL_PREFERENCE})
114-
115-
find_package(OpenGL REQUIRED)
107+
if(BUILD_CLIENT)
108+
if(ENABLE_GLES)
109+
find_package(OpenGLES2 REQUIRED)
110+
else()
111+
if(NOT WIN32) # Unix probably
112+
set(OPENGL_GL_PREFERENCE "LEGACY" CACHE STRING
113+
"See CMake Policy CMP0072 for reference. GLVND is broken on some nvidia setups")
114+
set(OpenGL_GL_PREFERENCE ${OPENGL_GL_PREFERENCE})
115+
116+
find_package(OpenGL REQUIRED)
117+
endif()
116118
endif()
117119
endif()
118120

0 commit comments

Comments
 (0)