Add MinGW (GCC) build support on Windows - #176
Open
DUDUACM wants to merge 1 commit into
Open
Conversation
- src/MCFloat.h: #undef FP_SNAN/FP_QNAN under MinGW only - mingw-w64's
math.h defines them as macros (MSVC does not), breaking the enum
- mdns_cpp/src/mdns.cpp: use in4addr_any only when compiling with MSVC;
the constant is not declared in mingw-w64 headers, fall back to
INADDR_ANY which is equivalent and portable
- CMakeLists.txt:
- call project() early so the compiler is identified before the MSVC
runtime flag setup, and keep those flags inherited by mdns_cpp
- apply WIN_RUNTIME_LIB (-MD/-MT) flags only for MSVC; GCC rejects
-MDd (invalid in Debug builds)
- link mswsock when not using MSVC: boost::asio needs
AcceptEx/GetAcceptExSockaddrs, which MSVC auto-links via
#pragma comment(lib) in the asio headers but MinGW does not
- fix Windows UNITTEST executable name: get_target_property on the
unset OUTPUT_NAME returned NOTFOUND, producing an executable named
"OUTPUT_NAME_OLD-NOTFOUND-MD.exe"
Verified with xerces-c 3.3.0 + boost 1.86.0 + MVR_XChange + unit tests:
MSVC Release/Debug and MinGW GCC 13.1 Release/Debug all build and pass
all 27 unit test suites. No behavior change for MSVC builds.
|
Thanks for opening this pull request! Please check out our contributing guidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Verified with xerces-c 3.3.0 + boost 1.86.0 + MVR_XChange + unit tests: MSVC Release/Debug and MinGW GCC 13.1 Release/Debug all build and pass all 27 unit test suites. No behavior change for MSVC builds.