1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:07:45 +00:00

CMake: Use a helper file to find GL and EGL in a platform agnostic way

Also add a flag to turn off accelerated graphics entirely.
This commit is contained in:
Andrew Kaster 2023-10-29 16:31:36 -06:00 committed by Andrew Kaster
parent bec1c1fff7
commit 49d21619d4
5 changed files with 23 additions and 7 deletions

View file

@ -0,0 +1,14 @@
if (NOT ENABLE_ACCELERATED_GRAPHICS OR EMSCRIPTEN)
# FIXME: Enable GL emulation in emscripten: https://emscripten.org/docs/porting/multimedia_and_graphics/OpenGL-support.html
set(HAS_ACCELERATED_GRAPHICS OFF CACHE BOOL "" FORCE)
return()
endif()
find_package(OpenGL COMPONENTS OpenGL EGL)
if (OPENGL_FOUND)
set(HAS_ACCELERATED_GRAPHICS ON CACHE BOOL "" FORCE)
set(ACCEL_GFX_LIBS OpenGL::OpenGL OpenGL::EGL CACHE STRING "" FORCE)
else()
set(HAS_ACCELERATED_GRAPHICS OFF CACHE BOOL "" FORCE)
endif()