aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2019-07-24 23:15:28 +0200
committersfan5 <sfan5@live.de>2019-08-04 16:12:52 +0200
commit526a9e4b66abaf83eb6b1aaa3e93375acd87b830 (patch)
tree05bbcc3ce1812950ee14d6afb8706bf02e5d6033 /src
parent4f7fa8d417074dadb085b367f756cade23e593c6 (diff)
downloadminetest-526a9e4b66abaf83eb6b1aaa3e93375acd87b830.tar.gz
minetest-526a9e4b66abaf83eb6b1aaa3e93375acd87b830.tar.bz2
minetest-526a9e4b66abaf83eb6b1aaa3e93375acd87b830.zip
Let ENABLE_GLES appear in cmake_config.h and change its functionality
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt31
-rw-r--r--src/cmake_config.h.in1
2 files changed, 23 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cb920e875..2627a0b97 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -102,10 +102,18 @@ if(BUILD_CLIENT AND ENABLE_SOUND)
endif()
-option(ENABLE_GLES "Enable OpenGL ES support" FALSE)
+option(ENABLE_GLES "Use OpenGL ES instead of OpenGL" FALSE)
mark_as_advanced(ENABLE_GLES)
if(ENABLE_GLES)
- find_package(OpenGLES2)
+ find_package(OpenGLES2 REQUIRED)
+elseif()
+ if(NOT WIN32) # Unix probably
+ set(OPENGL_GL_PREFERENCE "LEGACY" CACHE STRING
+ "See CMake Policy CMP0072 for reference. GLVND is broken on some nvidia setups")
+ set(OpenGL_GL_PREFERENCE ${OPENGL_GL_PREFERENCE})
+
+ find_package(OpenGL REQUIRED)
+ endif()
endif()
@@ -275,11 +283,6 @@ else()
find_package(X11 REQUIRED)
endif(NOT HAIKU)
- set(OPENGL_GL_PREFERENCE "LEGACY" CACHE STRING
- "See CMake Policy CMP0072 for reference. GLVND is broken on some nvidia setups")
- set(OpenGL_GL_PREFERENCE ${OPENGL_GL_PREFERENCE})
-
- find_package(OpenGL REQUIRED)
find_package(JPEG REQUIRED)
find_package(BZip2 REQUIRED)
find_package(PNG REQUIRED)
@@ -519,7 +522,6 @@ if(BUILD_CLIENT)
${PROJECT_NAME}
${ZLIB_LIBRARIES}
${IRRLICHT_LIBRARY}
- ${OPENGL_LIBRARIES}
${JPEG_LIBRARIES}
${BZIP2_LIBRARIES}
${PNG_LIBRARIES}
@@ -529,7 +531,6 @@ if(BUILD_CLIENT)
${LUA_LIBRARY}
${GMP_LIBRARY}
${JSON_LIBRARY}
- ${OPENGLES2_LIBRARIES}
${PLATFORM_LIBS}
${CLIENT_PLATFORM_LIBS}
)
@@ -543,6 +544,18 @@ if(BUILD_CLIENT)
${client_LIBS}
)
endif()
+ if(ENABLE_GLES)
+ target_link_libraries(
+ ${PROJECT_NAME}
+ ${OPENGLES2_LIBRARIES}
+ ${EGL_LIBRARIES}
+ )
+ else()
+ target_link_libraries(
+ ${PROJECT_NAME}
+ ${OPENGL_LIBRARIES}
+ )
+ endif()
if(USE_GETTEXT)
target_link_libraries(
${PROJECT_NAME}
diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in
index 81b8c2695..cb54cb488 100644
--- a/src/cmake_config.h.in
+++ b/src/cmake_config.h.in
@@ -26,6 +26,7 @@
#cmakedefine01 USE_SPATIAL
#cmakedefine01 USE_SYSTEM_GMP
#cmakedefine01 USE_REDIS
+#cmakedefine01 ENABLE_GLES
#cmakedefine01 HAVE_ENDIAN_H
#cmakedefine01 CURSES_HAVE_CURSES_H
#cmakedefine01 CURSES_HAVE_NCURSES_H