From cadcdda6b4e1f2a5a0388e523bb2a71a95044eae Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Mon, 18 Sep 2023 21:15:24 +0200 Subject: [PATCH] Add output for which GL implementation we build and always use GLES on Android --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3eb81b4a1..eec04a3c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)