cmake: only enable x11_xss/x11_xrandr/x11_xfixes when its lib is available
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
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})