libssh2 icon indicating copy to clipboard operation
libssh2 copied to clipboard

CMake: use only needed socket libs when checking nonblocking sockets

Open bk138 opened this issue 3 years ago • 2 comments

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

bk138 avatar Jun 20 '22 20:06 bk138

Is there any more info I can provide regarding this?

bk138 avatar Jul 09 '22 06:07 bk138

@willco007 friendly ping asking if more info is needed on this. Thanks!

bk138 avatar Aug 03 '22 20:08 bk138

Re-applying this fix to master: https://github.com/libssh2/libssh2/pull/816

vszakats avatar Mar 07 '23 18:03 vszakats