Add output for which GL implementation we build and always use GLES on Android

This commit is contained in:
Kai Blaschke
2023-09-18 21:15:24 +02:00
parent 5fe105cb31
commit cadcdda6b4

View File

@ -56,7 +56,7 @@ option(BUILD_TESTING "Build the libprojectM test suite" OFF)
cmake_dependent_option(BUILD_SHARED_LIBS "Build and install libprojectM as a shared libraries. If OFF, builds as static libraries." ON "NOT ENABLE_EMSCRIPTEN" OFF)
option(ENABLE_PLAYLIST "Enable building the playlist management library" ON)
cmake_dependent_option(ENABLE_SDL_UI "Build the SDL2-based developer test UI" OFF "NOT ENABLE_EMSCRIPTEN" OFF)
cmake_dependent_option(ENABLE_GLES "Enable OpenGL ES support" OFF "NOT ENABLE_EMSCRIPTEN" ON)
cmake_dependent_option(ENABLE_GLES "Enable OpenGL ES support" OFF "NOT ENABLE_EMSCRIPTEN AND NOT CMAKE_SYSTEM_NAME STREQUAL Android" ON)
cmake_dependent_option(ENABLE_OPENMP "Enable OpenMP support if available" ON "NOT ENABLE_EMSCRIPTEN" OFF)
cmake_dependent_option(ENABLE_THREADING "Enable multithreading support." ON "NOT ENABLE_EMSCRIPTEN" OFF)
option(ENABLE_SYSTEM_GLM "Enable use of system-install GLM library" OFF)
@ -118,8 +118,10 @@ else()
endif()
if(ENABLE_GLES)
if(NOT CMAKE_SYSTEM_NAME STREQUAL Linux)
message(FATAL_ERROR "OpenGL ES 3 support is currently only available for Linux platforms.")
message(STATUS "Building for OpenGL Embedded Profile")
if(NOT CMAKE_SYSTEM_NAME STREQUAL Linux
AND NOT CMAKE_SYSTEM_NAME STREQUAL Android)
message(FATAL_ERROR "OpenGL ES 3 support is currently only available for Linux platforms. You're building for ${CMAKE_SYSTEM_NAME}.")
endif()
# We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream.
@ -132,6 +134,7 @@ else()
set(PROJECTM_OPENGL_LIBRARIES OpenGL::GLES3)
set(USE_GLES ON)
else()
message(STATUS "Building for OpenGL Core Profile")
find_package(OpenGL REQUIRED)
set(PROJECTM_OPENGL_LIBRARIES OpenGL::GL)
# GLX is required by SOIL2 on platforms with the X Window System (e.g. most Linux distributions)