aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
Diffstat (limited to 'ports')
-rw-r--r--ports/gtest/CONTROL2
-rw-r--r--ports/gtest/fix-build-failure-in-gcc-11.patch22
-rw-r--r--ports/gtest/portfile.cmake1
3 files changed, 24 insertions, 1 deletions
diff --git a/ports/gtest/CONTROL b/ports/gtest/CONTROL
index 724569341..c483eda23 100644
--- a/ports/gtest/CONTROL
+++ b/ports/gtest/CONTROL
@@ -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.
diff --git a/ports/gtest/fix-build-failure-in-gcc-11.patch b/ports/gtest/fix-build-failure-in-gcc-11.patch
new file mode 100644
index 000000000..b0369892e
--- /dev/null
+++ b/ports/gtest/fix-build-failure-in-gcc-11.patch
@@ -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;
diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake
index 30e9dfb20..4cb45954e 100644
--- a/ports/gtest/portfile.cmake
+++ b/ports/gtest/portfile.cmake
@@ -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)