forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
5 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
if (LINUX) | ||
include(accelerated_graphics) | ||
|
||
if (HAS_ACCELERATED_GRAPHICS) | ||
set(SOURCES | ||
Canvas.cpp | ||
Context.cpp | ||
Painter.cpp | ||
) | ||
|
||
serenity_lib(LibAccelGfx accelgfx) | ||
target_link_libraries(LibAccelGfx PRIVATE LibGfx GL EGL) | ||
target_link_libraries(LibAccelGfx PRIVATE LibGfx ${ACCEL_GFX_LIBS}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters