Explicitly specify required X11 components

This commit is contained in:
kimci86 2023-02-07 22:13:35 +01:00 committed by Chris Thrasher
parent eb162df723
commit 205794eb3f
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ if(SFML_STATIC_LIBRARIES)
list(FIND SFML_FIND_COMPONENTS "Window" FIND_SFML_WINDOW_COMPONENT_INDEX) list(FIND SFML_FIND_COMPONENTS "Window" FIND_SFML_WINDOW_COMPONENT_INDEX)
if(FIND_SFML_WINDOW_COMPONENT_INDEX GREATER -1) if(FIND_SFML_WINDOW_COMPONENT_INDEX GREATER -1)
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD) if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
find_dependency(X11) find_dependency(X11 REQUIRED COMPONENTS Xrandr Xcursor)
endif() endif()
if(FIND_SFML_OS_LINUX) if(FIND_SFML_OS_LINUX)

View File

@ -285,7 +285,7 @@ if(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_OPENBSD OR SFML_OS_NETBSD)
sfml_find_package(GBM INCLUDE "GBM_INCLUDE_DIR" LINK "GBM_LIBRARY") sfml_find_package(GBM INCLUDE "GBM_INCLUDE_DIR" LINK "GBM_LIBRARY")
target_link_libraries(sfml-window PRIVATE drm gbm EGL) target_link_libraries(sfml-window PRIVATE drm gbm EGL)
else() else()
find_package(X11 REQUIRED) find_package(X11 REQUIRED COMPONENTS Xrandr Xcursor)
target_link_libraries(sfml-window PRIVATE X11::X11 X11::Xrandr X11::Xcursor) target_link_libraries(sfml-window PRIVATE X11::X11 X11::Xrandr X11::Xcursor)
endif() endif()
endif() endif()