mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 05:24:58 +00:00

This allows ports to access the OpenGL headers using `#include <GL/gl.h>` and find the shared library at `/usr/lib/libGL.so` or `/usr/lib/libGL.so.1`, removing the need for explicit include paths or changed library names.
38 lines
915 B
CMake
38 lines
915 B
CMake
include(libgl_generators)
|
|
|
|
set(SOURCES
|
|
Buffer/Buffer.cpp
|
|
Buffer.cpp
|
|
ClipPlane.cpp
|
|
ContextParameter.cpp
|
|
GLContext.cpp
|
|
Image.cpp
|
|
Lighting.cpp
|
|
List.cpp
|
|
Matrix.cpp
|
|
NameAllocator.cpp
|
|
Shader.cpp
|
|
Shaders/Program.cpp
|
|
Shaders/Shader.cpp
|
|
Stencil.cpp
|
|
Tex/Texture2D.cpp
|
|
Texture.cpp
|
|
Vertex.cpp
|
|
)
|
|
|
|
generate_libgl_implementation()
|
|
|
|
set(GENERATED_SOURCES
|
|
GLAPI.cpp)
|
|
|
|
serenity_lib(LibGL gl)
|
|
target_link_libraries(LibGL PRIVATE LibGfx LibGLSL LibGPU)
|
|
|
|
# Install symlinks at some common locations so ports can find LibGL without issue
|
|
if (SERENITYOS)
|
|
install(CODE "
|
|
file(CREATE_LINK LibGL/GL/ \${CMAKE_INSTALL_PREFIX}/usr/include/GL SYMBOLIC)
|
|
file(CREATE_LINK libgl.so.serenity \${CMAKE_INSTALL_PREFIX}/usr/lib/libGL.so SYMBOLIC)
|
|
file(CREATE_LINK libgl.so.serenity \${CMAKE_INSTALL_PREFIX}/usr/lib/libGL.so.1 SYMBOLIC)
|
|
")
|
|
endif()
|