mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
[aws-sdk-cpp] Fix linking issue when using MinGW (#39064)
It appears like the aws-sdk-cpp maintainers, in an attempt to avoid a warning when compiling with Visual Studio, opted to use a Microsoft-only function for reading environment variables. As a result, linking the library will fail in MinGW environments. This PR adds a patch to aws-sdk-cpp port that will replace the non-standard function with a standard compliant version when being compiled for Windows using a non-Microsoft compiler. - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] SHA512s are updated for each updated download. - [ ] The "supports" clause reflects platforms that may be fixed by this new version. - [ ] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file. - [ ] Any patches that are no longer applied are deleted from the port's directory. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file.
This commit is contained in:
parent
b43063e2fd
commit
283f99c84a
23
ports/aws-sdk-cpp/fix-mingw-compatibility.patch
Normal file
23
ports/aws-sdk-cpp/fix-mingw-compatibility.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff --git a/src/aws-cpp-sdk-core/source/platform/windows/Environment.cpp b/src/aws-cpp-sdk-core/source/platform/windows/Environment.cpp
|
||||
index d8b540312..b552a9dbf 100644
|
||||
--- a/src/aws-cpp-sdk-core/source/platform/windows/Environment.cpp
|
||||
+++ b/src/aws-cpp-sdk-core/source/platform/windows/Environment.cpp
|
||||
@@ -19,6 +19,7 @@ that would need to be manually freed in all the client functions, just copy it i
|
||||
*/
|
||||
Aws::String GetEnv(const char *variableName)
|
||||
{
|
||||
+#ifdef _MSC_VER
|
||||
char* variableValue = nullptr;
|
||||
std::size_t valueSize = 0;
|
||||
auto queryResult = _dupenv_s(&variableValue, &valueSize, variableName);
|
||||
@@ -31,6 +32,10 @@ Aws::String GetEnv(const char *variableName)
|
||||
}
|
||||
|
||||
return result;
|
||||
+#else
|
||||
+ auto variableValue = std::getenv(variableName);
|
||||
+ return Aws::String( variableValue ? variableValue : "" );
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace Environment
|
@ -10,6 +10,7 @@ vcpkg_from_github(
|
||||
fix-aws-root.patch
|
||||
lock-curl-http-and-tls-settings.patch
|
||||
fix_find_curl.patch
|
||||
fix-mingw-compatibility.patch
|
||||
)
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" FORCE_SHARED_CRT)
|
||||
|
@ -2,7 +2,7 @@
|
||||
"$note": "Automatically generated by generateFeatures.ps1",
|
||||
"name": "aws-sdk-cpp",
|
||||
"version": "1.11.285",
|
||||
"port-version": 2,
|
||||
"port-version": 3,
|
||||
"description": "AWS SDK for C++",
|
||||
"homepage": "https://github.com/aws/aws-sdk-cpp",
|
||||
"license": "Apache-2.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "27092f8627e032baefd12137452180975e1715d1",
|
||||
"version": "1.11.285",
|
||||
"port-version": 3
|
||||
},
|
||||
{
|
||||
"git-tree": "252f02a82047e15da94b42568b63b4064ae55e56",
|
||||
"version": "1.11.285",
|
||||
|
@ -426,7 +426,7 @@
|
||||
},
|
||||
"aws-sdk-cpp": {
|
||||
"baseline": "1.11.285",
|
||||
"port-version": 2
|
||||
"port-version": 3
|
||||
},
|
||||
"azmq": {
|
||||
"baseline": "2023-03-23",
|
||||
|
Loading…
x
Reference in New Issue
Block a user