From ad7c72c1648a710c2d091993c9249bd3d2b607a5 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 26 Feb 2022 15:16:38 +0100 Subject: [PATCH] Remove direct OpenGL(ES) dependency IrrlichtMt now provides this for us (see last commit) fixes #12041 --- README.md | 5 +-- cmake/Modules/FindOpenGLES2.cmake | 73 ------------------------------- src/CMakeLists.txt | 31 +------------ 3 files changed, 3 insertions(+), 106 deletions(-) delete mode 100644 cmake/Modules/FindOpenGLES2.cmake diff --git a/README.md b/README.md index 19de0cc2b..8f089ab48 100644 --- a/README.md +++ b/README.md @@ -249,7 +249,7 @@ General options and their default values: ENABLE_CURL=ON - Build with cURL; Enables use of online mod repo, public serverlist and remote media fetching via http ENABLE_CURSES=ON - Build with (n)curses; Enables a server side terminal (command line option: --terminal) ENABLE_GETTEXT=ON - Build with Gettext; Allows using translations - ENABLE_GLES=OFF - Build for OpenGL ES instead of OpenGL (requires support by IrrlichtMt) + ENABLE_GLES=OFF - Enable extra support code for OpenGL ES (requires support by IrrlichtMt) ENABLE_LEVELDB=ON - Build with LevelDB; Enables use of LevelDB map backend ENABLE_POSTGRESQL=ON - Build with libpq; Enables use of PostgreSQL map backend (PostgreSQL 9.5 or greater recommended) ENABLE_REDIS=ON - Build with libhiredis; Enables use of Redis map backend @@ -259,7 +259,6 @@ General options and their default values: ENABLE_PROMETHEUS=OFF - Build with Prometheus metrics exporter (listens on tcp/30000 by default) ENABLE_SYSTEM_GMP=ON - Use GMP from system (much faster than bundled mini-gmp) ENABLE_SYSTEM_JSONCPP=ON - Use JsonCPP from system - OPENGL_GL_PREFERENCE=LEGACY - Linux client build only; See CMake Policy CMP0072 for reference RUN_IN_PLACE=FALSE - Create a portable install (worlds, settings etc. in current directory) USE_GPROF=FALSE - Enable profiling using GProf VERSION_EXTRA= - Text to append to version (e.g. VERSION_EXTRA=foobar -> Minetest 0.4.9-foobar) @@ -300,8 +299,6 @@ Library specific options: OPENAL_DLL - Only if building with sound on Windows; path to OpenAL32.dll OPENAL_INCLUDE_DIR - Only if building with sound; directory where al.h is located OPENAL_LIBRARY - Only if building with sound; path to libopenal.a/libopenal.so/OpenAL32.lib - OPENGLES2_INCLUDE_DIR - Only if building with GLES; directory that contains gl2.h - OPENGLES2_LIBRARY - Only if building with GLES; path to libGLESv2.a/libGLESv2.so SQLITE3_INCLUDE_DIR - Directory that contains sqlite3.h SQLITE3_LIBRARY - Path to libsqlite3.a/libsqlite3.so/sqlite3.lib VORBISFILE_LIBRARY - Only if building with sound; path to libvorbisfile.a/libvorbisfile.so/libvorbisfile.dll.a diff --git a/cmake/Modules/FindOpenGLES2.cmake b/cmake/Modules/FindOpenGLES2.cmake deleted file mode 100644 index ce04191dd..000000000 --- a/cmake/Modules/FindOpenGLES2.cmake +++ /dev/null @@ -1,73 +0,0 @@ -#------------------------------------------------------------------- -# The contents of this file are placed in the public domain. Feel -# free to make use of it in any way you like. -#------------------------------------------------------------------- - -# - Try to find OpenGLES and EGL -# Once done this will define -# -# OPENGLES2_FOUND - system has OpenGLES -# OPENGLES2_INCLUDE_DIR - the GL include directory -# OPENGLES2_LIBRARIES - Link these to use OpenGLES -# -# EGL_FOUND - system has EGL -# EGL_INCLUDE_DIR - the EGL include directory -# EGL_LIBRARIES - Link these to use EGL - -# Win32 and Apple are not tested! -# Linux tested and works - -if(WIN32) - find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h) - find_library(OPENGLES2_LIBRARY libGLESv2) -elseif(APPLE) - create_search_paths(/Developer/Platforms) - findpkg_framework(OpenGLES2) - set(OPENGLES2_LIBRARY "-framework OpenGLES") -else() - # Unix - find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h - PATHS /usr/openwin/share/include - /opt/graphics/OpenGL/include - /usr/X11R6/include - /usr/include - ) - - find_library(OPENGLES2_LIBRARY - NAMES GLESv2 - PATHS /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/X11R6/lib - /usr/lib - ) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG OPENGLES2_LIBRARY OPENGLES2_INCLUDE_DIR) - - find_path(EGL_INCLUDE_DIR EGL/egl.h - PATHS /usr/openwin/share/include - /opt/graphics/OpenGL/include - /usr/X11R6/include - /usr/include - ) - - find_library(EGL_LIBRARY - NAMES EGL - PATHS /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/X11R6/lib - /usr/lib - ) - - find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR) -endif() - -set(OPENGLES2_LIBRARIES ${OPENGLES2_LIBRARY}) -set(EGL_LIBRARIES ${EGL_LIBRARY}) - -mark_as_advanced( - OPENGLES2_INCLUDE_DIR - OPENGLES2_LIBRARY - EGL_INCLUDE_DIR - EGL_LIBRARY -) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 57baf20bd..1d6177ba3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -98,8 +98,8 @@ if(BUILD_CLIENT AND ENABLE_SOUND) endif() endif() - -option(ENABLE_GLES "Use OpenGL ES instead of OpenGL" FALSE) +# TODO: this should be removed one day, we can enable it unconditionally +option(ENABLE_GLES "Enable extra support code for OpenGL ES" FALSE) mark_as_advanced(ENABLE_GLES) option(ENABLE_TOUCH "Enable Touchscreen support" FALSE) @@ -107,21 +107,6 @@ if(ENABLE_TOUCH) add_definitions(-DHAVE_TOUCHSCREENGUI) endif() -if(BUILD_CLIENT) - # transitive dependency from Irrlicht (see longer explanation below) - if(NOT WIN32) - if(ENABLE_GLES) - find_package(OpenGLES2 REQUIRED) - else() - 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() -endif() - if(BUILD_CLIENT) find_package(Freetype REQUIRED) endif() @@ -544,18 +529,6 @@ if(BUILD_CLIENT) ) 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}