1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 03:14:59 +00:00

LibGL: Create symlinks for headers and shared library

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.
This commit is contained in:
Jelle Raaijmakers 2024-02-21 16:06:21 +01:00 committed by Tim Schumacher
parent 5cff59557e
commit 857ab2e06d

View file

@ -27,3 +27,12 @@ set(GENERATED_SOURCES
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()