aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorTwice <i@twice.moe>2021-01-16 07:20:45 +0800
committerGitHub <noreply@github.com>2021-01-15 15:20:45 -0800
commit6df7d6612bf7c1ee983748dfe53196e8c983ff78 (patch)
tree52d968235e7f34405318974c47dff07fc3ead026 /ports
parentd9351c9c3f1e17593c5fe078218c5d07cf746922 (diff)
downloadvcpkg-6df7d6612bf7c1ee983748dfe53196e8c983ff78.tar.gz
vcpkg-6df7d6612bf7c1ee983748dfe53196e8c983ff78.zip
[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
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)