Skip to content

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented May 1, 2024

This PR ports bitcoin#29904 after the recent sync/rebase PR.

@hebasto hebasto added the port from autotools Ported from the main repository label May 1, 2024
@hebasto hebasto marked this pull request as draft May 1, 2024 15:39
@theuni
Copy link

theuni commented May 1, 2024

LGTM.

@hebasto hebasto force-pushed the 240501-cmake-EN branch from 972b6c9 to d3e2199 Compare May 1, 2024 20:12
@hebasto hebasto marked this pull request as ready for review May 1, 2024 20:15
@hebasto
Copy link
Owner Author

hebasto commented May 1, 2024

@theuni

I've fixed a Windows-specific issue. Do you mind re-reviewing please?

@hebasto hebasto force-pushed the 240501-cmake-EN branch from d3e2199 to 29e6154 Compare May 1, 2024 20:19
@hebasto
Copy link
Owner Author

hebasto commented May 1, 2024

... and rebased to resolve a conflict.

@theuni
Copy link

theuni commented May 1, 2024

@hebasto When you add something like that to a PR like this, could you please provide some context?

Why is ws2_32 needed now?

@hebasto
Copy link
Owner Author

hebasto commented May 1, 2024

@hebasto When you add something like that to a PR like this, could you please provide some context?

Sure. Sorry for inappropriate succinctness.

Why is ws2_32 needed now?

The reason is the actual usage of WinSock in

WSADATA wsadata;
int ret = WSAStartup(MAKEWORD(2,2), &wsadata);

Before this change, ws2_32 was linked transitively via the libevent library.

@theuni
Copy link

theuni commented May 1, 2024

Elsewhere we have:

if(MINGW)
  target_link_libraries(bitcoin_util
    PRIVATE
      ws2_32
  )

Shouldn't we be using the same approach in both places? Does the above really only apply to mingw and not Windows generally?

Unified `ws2_32` link approach.
@hebasto
Copy link
Owner Author

hebasto commented May 1, 2024

Elsewhere we have:

if(MINGW)
  target_link_libraries(bitcoin_util
    PRIVATE
      ws2_32
  )

Shouldn't we be using the same approach in both places? Does the above really only apply to mingw and not Windows generally?

Agree. A "fixup! .." commit has been added.

Copy link

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hebasto hebasto merged commit 6e4f2e0 into cmake-staging May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port from autotools Ported from the main repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants