From 3e926d65a0dab63b098a9161075a2cf634d3ef23 Mon Sep 17 00:00:00 2001 From: Maicon Santana Date: Thu, 5 Mar 2026 13:51:16 +0000 Subject: [PATCH] add x11 libraries for raylib as glfw make private (#5625) --- src/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8b14bda90..0975457ee 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -117,6 +117,21 @@ target_include_directories(raylib # Copy the header files to the build directory for convenience file(COPY ${raylib_public_headers} DESTINATION "include") +if (PLATFORM STREQUAL "Desktop") + if (UNIX AND NOT APPLE) + if (GLFW_BUILD_X11) + find_package(X11 REQUIRED) + + target_compile_definitions(raylib PRIVATE _GLFW_X11) + + target_link_libraries(raylib PRIVATE + ${X11_LIBRARIES} + ) + + message(STATUS "X11 support enabled for raylib") + endif() + endif() +endif() # Includes information on how the library will be installed on the system # when cmake --install is run