diff --git a/qb/config.libs.sh b/qb/config.libs.sh
index 484f589052..e2da00cc4e 100644
--- a/qb/config.libs.sh
+++ b/qb/config.libs.sh
@@ -113,12 +113,6 @@ else
    check_lib AL -lopenal alcOpenDevice
 fi
 
-if [ "$OS" = 'Darwin' ]; then
-   check_lib FBO "-framework OpenGL" glFramebufferTexture2D
-else
-   check_lib FBO -lGL glFramebufferTexture2D
-fi
-
 check_pkgconf RSOUND rsound 1.1
 check_pkgconf ROAR libroar
 check_pkgconf JACK jack 0.120.1
@@ -195,6 +189,16 @@ else
    HAVE_GLES=no
 fi
 
+if [ "$OS" = 'Darwin' ]; then
+   check_lib FBO "-framework OpenGL" glFramebufferTexture2D
+else
+   if [ "$HAVE_GLES" = "yes" ]; then
+      [ $HAVE_FBO != "no" ] && HAVE_FBO=yes
+   else
+      check_lib FBO -lGL glFramebufferTexture2D
+   fi
+fi
+
 check_pkgconf FREETYPE freetype2
 check_pkgconf X11 x11
 [ "$HAVE_X11" = "no" ] && HAVE_XEXT=no && HAVE_XF86VM=no && HAVE_XINERAMA=no