Commit aa7a6c0ea662c5e48b21f320459efe9fd43ba3b4

Anonymous Maarten 2022-07-21T14:38:57

cmake: only enable x11_xcursor and x11_xinput when its library is available

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 31d2648..f1bf84f 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -520,9 +520,9 @@ macro(CheckX11)
 
       check_symbol_exists(XkbKeycodeToKeysym "X11/Xlib.h;X11/XKBlib.h" SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM)
 
-      if(SDL_X11_XCURSOR AND HAVE_XCURSOR_H)
+      if(SDL_X11_XCURSOR AND HAVE_XCURSOR_H AND XCURSOR_LIB)
         set(HAVE_X11_XCURSOR TRUE)
-        if(HAVE_X11_SHARED AND XCURSOR_LIB)
+        if(HAVE_X11_SHARED)
           set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB_SONAME}\"")
         else()
           list(APPEND EXTRA_LIBS ${XCURSOR_LIB})
@@ -535,9 +535,9 @@ macro(CheckX11)
         set(SDL_VIDEO_DRIVER_X11_XDBE 1)
       endif()
 
-      if(SDL_X11_XINPUT AND HAVE_XINPUT2_H)
+      if(SDL_X11_XINPUT AND HAVE_XINPUT2_H AND XI_LIB)
         set(HAVE_X11_XINPUT TRUE)
-        if(HAVE_X11_SHARED AND XI_LIB)
+        if(HAVE_X11_SHARED)
           set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB_SONAME}\"")
         else()
           list(APPEND EXTRA_LIBS ${XI_LIB})