Skip to content

cmake: use only socket libs when checking non-blocking sockets - #816

Merged
vszakats merged 1 commit into
libssh2:masterfrom
vszakats:cmake-nonblock-check
Mar 8, 2023
Merged

vszakats merged 1 commit into
libssh2:masterfrom
vszakats:cmake-nonblock-check

Conversation

@vszakats

@vszakats vszakats commented Mar 7, 2023 •

Copy link
Copy Markdown
Member

Based on patch by Christian Beier:

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.

Fixes #694
Closes #712

@vszakats vszakats changed the title cmake: use only needed socket libs when checking non-blocking sockets cmake: use only socket libs when checking non-blocking sockets Mar 7, 2023
@vszakats

vszakats commented Mar 8, 2023

Copy link
Copy Markdown
Member Author

/cc @bk138

Merging this for now. Feel free to comment / reopen if it didn't fix the original issue.

@vszakats
vszakats merged commit 9ad1258 into libssh2:master Mar 8, 2023
@vszakats
vszakats deleted the cmake-nonblock-check branch March 8, 2023 12:56
@bk138

bk138 commented Mar 8, 2023

Copy link
Copy Markdown

Works for me @vszakats, thanks!

bk138 added a commit to bk138/multivnc that referenced this pull request Mar 8, 2023
Finally libssh2/libssh2#816 fixed the Android issue,
no need for our own branch anymore.
bk138 added a commit to bk138/multivnc that referenced this pull request Aug 25, 2023
Finally libssh2/libssh2#816 fixed the Android issue,
no need for our own branch anymore.
bk138 added a commit to bk138/multivnc that referenced this pull request Aug 25, 2023
Finally libssh2/libssh2#816 fixed the Android issue,
no need for our own branch anymore.
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_libssh2_transport_read block forever on Android with OpenSSL

2 participants