CMake: use only needed socket libs when checking nonblocking sockets
When building libssh2 and the libraries it depends on from source using a single CMakeLists.txt (as is common on Android), libssh2's CMake has to be hinted at where to find other libs by setting variables like OPENSSL_SSL_LIBRARY and so on.
Now, as under Android there's one single CMakeLists.txt that has to
add_subdirectory() all other CMakeLists.txt, there's only one
configure phase and one build phase. That means when libssh2 is
configured, the libs it is configured to use are actually not built
yet.
In this case it's a problem to use the libs in LIBRARIES when checking for nonblocking sockets as some libs in there are not yet built, failing the test and ending up with HAVE_DISABLED_NONBLOCKING in libssh2_config.h.
Fix this by using a separate, clean library list for the nonblocking socket checks.
Closes #694
Is there any more info I can provide regarding this?
@willco007 friendly ping asking if more info is needed on this. Thanks!
Re-applying this fix to master: https://github.com/libssh2/libssh2/pull/816