-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add support for building with MinGW #604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took so long to notice this PR
Good work!
source/windows/environment.c
Outdated
#pragma warning(disable : 4996) | ||
#ifndef __MINGW32__ | ||
# pragma warning(push) | ||
# pragma warning(disable : 4996) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please comment what warning this disables (and say why if it's not immediately obvious why one would disable it)
For example, this is how we usually disable some MSVC-specific warnings
#if _MSC_VER
# pragma warning(disable : 4221) /* aggregate initializer using local variable addresses */
# pragma warning(disable : 4204) /* non-constant aggregate initializer */
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and the same construct in system_info.c
) only looks like it's a newly disabled warning because of indentation changes. It's actually just disabling the MSVC specific #pragma when using MinGW as GCC can't understand MSVC warning codes.
58f298e
to
37e5f51
Compare
I've rebased to current master in order to trigger the CI again but it looks like it's still not working correctly |
Bump. As I mentioned over in aws/aws-sdk-cpp#1426, we are interested in support for the mingw-w64 target (as are others like @nealrichardson). @graebm, I see you are now using github actions: would you accept a PR to add a mingw-w64 target to the build matrix? |
FYI, we have adopted a modified version of this patch in msys2 mingw-w64-aws-sdk-cpp. To install binaries from msys2 use pacman -Syu
pacman -S mingw-w64-{i686,x86_64}-aws-sdk-cpp |
Issue #, if available:
Description of changes:
This PR makes it possible to build aws-c-common with the MinGW toolchain on Windows.
The main changes are adding checks for the
__MINGW32__
define which is preset on both 32 and 64 bit MinGW installations. Additionally MinGW needs changes related to format strings such as defining__USE_MINGW_ANSI_STDIO
and using thegnu_printf
attribute.Building with MSVC still works as before these changes. The test pass on both MinGW and MSVC.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.