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:
parent
bec1c1fff7
commit
49d21619d4
5 changed files with 23 additions and 7 deletions
14
Meta/CMake/accelerated_graphics.cmake
Normal file
14
Meta/CMake/accelerated_graphics.cmake
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue