[gtest] Add a patch to fix build error in GCC 11 (#15661)

* [gtest] Add a patch to fix build error in GCC 11

* [gtest] Bump port version to 3

* [gtest] Update version files
This commit is contained in:
Twice 2021-01-16 07:20:45 +08:00 committed by GitHub
parent d9351c9c3f
commit 6df7d6612b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 2 deletions

View File

@ -2270,7 +2270,7 @@
},
"gtest": {
"baseline": "1.10.0",
"port-version": 2
"port-version": 3
},
"gtk": {
"baseline": "3.22.19-4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e94f8c09a8fa6ed7fc618734d412878d83069bfb",
"version-string": "1.10.0",
"port-version": 3
},
{
"git-tree": "88de073e86bcae80206fca0ff4f4f8e6c165f43a",
"version-string": "1.10.0",

View File

@ -1,5 +1,5 @@
Source: gtest
Version: 1.10.0
Port-Version: 2
Port-Version: 3
Homepage: https://github.com/google/googletest
Description: GoogleTest and GoogleMock testing frameworks.

View File

@ -0,0 +1,22 @@
diff --git a/googletest/src/gtest-death-test.cc b/googletest/src/gtest-death-test.cc
index da09a1cf..43cbd78a 100644
--- a/googletest/src/gtest-death-test.cc
+++ b/googletest/src/gtest-death-test.cc
@@ -1288,7 +1288,7 @@ static void StackLowerThanAddress(const void* ptr,
// making comparison result unpredictable.
GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
static void StackLowerThanAddress(const void* ptr, bool* result) {
- int dummy;
+ int dummy = 0;
*result = (&dummy < ptr);
}
@@ -1296,7 +1296,7 @@ static void StackLowerThanAddress(const void* ptr, bool* result) {
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
static bool StackGrowsDown() {
- int dummy;
+ int dummy = 0;
bool result;
StackLowerThanAddress(&dummy, &result);
return result;

View File

@ -11,6 +11,7 @@ vcpkg_from_github(
PATCHES
0002-Fix-z7-override.patch
fix-main-lib-path.patch
fix-build-failure-in-gcc-11.patch
)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" GTEST_FORCE_SHARED_CRT)