Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix mingw-w64 compilation with CMake #4672

Closed
wants to merge 1 commit into from

Conversation

fanquake
Copy link
Contributor

Set ZMQ_HAVE_IPC OFF for all Windows builds, rather than just WindowsStore builds.

This fixes compiling with mingw-w64, and mirrors the autotools builds system:

libzmq/configure.ac

Lines 145 to 152 in 2a75ef0

# Disable IPC on unsupported platforms.
case "${host_os}" in
*vxworks*|*openvms*|*mingw*)
;;
*)
AC_DEFINE(ZMQ_HAVE_IPC, 1, [Have AF_UNIX sockets for ipc transport])
;;
esac

Set `ZMQ_HAVE_IPC OFF` all Windows builds, rather than just
`WindowsStore` builds. This fixes compiling with mingw-w64, and mirrors
the autotools builds system:
```bash
case "${host_os}" in
    *vxworks*|*openvms*|*mingw*)
        ;;
```
@fanquake fanquake changed the title build: fix mingw-w64 compilation build: fix mingw-w64 compilation with CMake Mar 27, 2024
@bluca
Copy link
Member

bluca commented Mar 27, 2024

Why? AF_UNIX was added some years ago to Windows

@fanquake
Copy link
Contributor Author

Why? AF_UNIX was added some years ago to Windows

Is there as reason it's still disabled in the autotools build then?

@bluca
Copy link
Member

bluca commented Mar 27, 2024

I don't know if anybody uses autotools on windows, doubt it

@fanquake
Copy link
Contributor Author

I don't know if anybody uses autotools on windows, doubt it

I don't know what you mean. The Autotools build system here is used extensively for cross-compiling Windows libs on Linux, via mingw-w64.

@bluca
Copy link
Member

bluca commented Mar 27, 2024

That may very well be, doesn't change the fact that AF_UNIX is available on windows and it doesn't make sense to disable it

@fanquake
Copy link
Contributor Author

fanquake commented Mar 27, 2024

Sure. So what is your preferred approach for handling mingw-w64 builds via CMake? Note that this is the second of two issues (see #4669). Should we handled this in the build system, in the code? Is mingw-w64 officially unsupported via CMake?

@stephanlachnit
Copy link
Contributor

The actual issue with mingw is actually wrong usage of _MSC_VER, I fixed it in #4678

@bluca bluca closed this Apr 23, 2024
@fanquake fanquake deleted the fix_windows_comp branch April 24, 2024 00:08
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.

None yet

3 participants