Skip to content

cmake: Port PR29904 from the master branch - #181

Merged
hebasto merged 3 commits into
cmake-stagingfrom
240501-cmake-EN
May 3, 2024
Merged

hebasto merged 3 commits into
cmake-stagingfrom
240501-cmake-EN

Conversation

@hebasto

@hebasto hebasto commented May 1, 2024 •

Copy link
Copy Markdown
Owner

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

theuni commented May 1, 2024

Copy link
Copy Markdown

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

hebasto commented May 1, 2024

Copy link
Copy Markdown
Owner Author

@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

hebasto commented May 1, 2024

Copy link
Copy Markdown
Owner Author

... and rebased to resolve a conflict.

@theuni

theuni commented May 1, 2024

Copy link
Copy Markdown

@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

hebasto commented May 1, 2024

Copy link
Copy Markdown
Owner Author

@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

theuni commented May 1, 2024

Copy link
Copy Markdown

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

hebasto commented May 1, 2024

Copy link
Copy Markdown
Owner Author

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.

@sedited sedited left a comment

Copy link
Copy Markdown

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