Commit 9ad3711a6b827f5d3923f31386507d6acc2429d6

Anonymous Maarten 2022-07-21T15:19:19

cmake: only enable x11_xss/x11_xrandr/x11_xfixes when its lib is available

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index f1bf84f..b0a1d79 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -570,8 +570,8 @@ macro(CheckX11)
             BarrierEventID b;
             int main(int argc, char **argv) { return 0; }" HAVE_XFIXES_H)
       endif()
-      if(SDL_X11_XFIXES AND HAVE_XFIXES_H AND HAVE_XINPUT2_H)
-        if(HAVE_X11_SHARED AND XFIXES_LIB)
+      if(SDL_X11_XFIXES AND HAVE_XFIXES_H AND HAVE_XINPUT2_H AND XFIXES_LIB)
+        if(HAVE_X11_SHARED)
           set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES "\"${XFIXES_LIB_SONAME}\"")
         else()
           list(APPEND EXTRA_LIBS ${XFIXES_LIB})
@@ -580,8 +580,8 @@ macro(CheckX11)
         set(HAVE_X11_XFIXES TRUE)
       endif()
 
-      if(SDL_X11_XRANDR AND HAVE_XRANDR_H)
-        if(HAVE_X11_SHARED AND XRANDR_LIB)
+      if(SDL_X11_XRANDR AND HAVE_XRANDR_H AND XRANDR_LIB)
+        if(HAVE_X11_SHARED)
           set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB_SONAME}\"")
         else()
           list(APPEND EXTRA_LIBS ${XRANDR_LIB})
@@ -590,8 +590,8 @@ macro(CheckX11)
         set(HAVE_X11_XRANDR TRUE)
       endif()
 
-      if(SDL_X11_XSCRNSAVER AND HAVE_XSS_H)
-        if(HAVE_X11_SHARED AND XSS_LIB)
+      if(SDL_X11_XSCRNSAVER AND HAVE_XSS_H AND XSS_LIB)
+        if(HAVE_X11_SHARED)
           set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB_SONAME}\"")
         else()
           list(APPEND EXTRA_LIBS ${XSS_LIB})