ladybird/Meta/CMake/accelerated_graphics.cmake
Timothy Flynn 82398e5724 Meta: Silence warnings from optional CMake packages
These can be quite verbose on the command line if the packages aren't
found. As they do not break the build, let's not spam warnings.

The OpenGL package is also now skipped on macOS, where there's no point
in looking for the package anyways.
2023-11-28 06:54:16 -05:00

19 lines
707 B
CMake

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()
if (APPLE)
set(HAS_ACCELERATED_GRAPHICS ON CACHE BOOL "" FORCE)
set(ACCEL_GFX_LIBS "-framework OpenGL" CACHE STRING "" FORCE)
else()
find_package(OpenGL QUIET 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()
endif()