aws-sdk-cpp icon indicating copy to clipboard operation
aws-sdk-cpp copied to clipboard

Add support for building with MinGW

Open trilader opened this issue 4 years ago • 2 comments

Issue #, if available:

Description of changes: This PR adds support for building aws-sdk-cpp with the MinGW toolchain on Windows. Needs https://github.com/awslabs/aws-c-common/pull/604 in order to work.

The main changes are adding checks for the MINGW32 define which is preset on both 32 and 64 bit MinGW installations, silencing some bogus warnings and addressing some 0 vs NULL cases which gcc complains about.

I don't this this needs explicit tests but might need additional CI work to ensure MinGW continues to work in the future. Regarding ReadMe/Wiki: It might need mentioning that building with MinGW is supported.

Check all that applies:

  • [x] Did a review by yourself.
  • [ ] Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • [ ] Checked if this PR is a breaking (APIs have been changed) change.
  • [ ] Checked if this PR will not introduce cross-platform inconsistent behavior.
  • [x] Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • [x] Linux
  • [x] Windows
  • [ ] Android
  • [ ] MacOS
  • [ ] IOS
  • [ ] Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

trilader avatar Mar 03 '20 10:03 trilader

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

jeroen avatar Aug 15 '20 09:08 jeroen