From d4fe0ff1d14c02e63f70fe3448ffe3fa6af04007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bernhard.rosenkraenzer.ext@huawei.com> Date: Wed, 7 Jul 2021 17:31:16 +0200 Subject: [PATCH] Fix googletest to build with gcc 11.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Googletest doesn't compile with gcc 11.1 because it doesn't explicitly include <string> -- this is included implicitly (dependency of other headers) by older libstdc++ as well as libc++ Signed-off-by: Bernhard Rosenkränzer <bernhard.rosenkraenzer.ext@huawei.com> --- .../ohos-googletest/googletest-gcc-11.patch | 13 +++++++++++++ .../ohos-googletest/ohos-googletest_git.bb | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 meta-ohos-acts/recipes-ohos-googletest/ohos-googletest/ohos-googletest/googletest-gcc-11.patch diff --git a/meta-ohos-acts/recipes-ohos-googletest/ohos-googletest/ohos-googletest/googletest-gcc-11.patch b/meta-ohos-acts/recipes-ohos-googletest/ohos-googletest/ohos-googletest/googletest-gcc-11.patch new file mode 100644 index 00000000..ed13bcb8 --- /dev/null +++ b/meta-ohos-acts/recipes-ohos-googletest/ohos-googletest/ohos-googletest/googletest-gcc-11.patch @@ -0,0 +1,13 @@ +diff -up git/googletest/include/gtest/hwext/gtest-tag.h.omv~ git/googletest/include/gtest/hwext/gtest-tag.h +--- git/googletest/include/gtest/hwext/gtest-tag.h.omv~ 2021-07-06 19:01:12.828013607 +0200 ++++ git/googletest/include/gtest/hwext/gtest-tag.h 2021-07-06 19:01:24.291492486 +0200 +@@ -3,7 +3,8 @@ + #ifndef GTEST_INCLUDE_GTEST_GTEST_TAG_H_ + #define GTEST_INCLUDE_GTEST_GTEST_TAG_H_ + +-#include <string.h> ++#include <string> ++#include <cstring> + #include <map> + #include <vector> + diff --git a/meta-ohos-acts/recipes-ohos-googletest/ohos-googletest/ohos-googletest_git.bb b/meta-ohos-acts/recipes-ohos-googletest/ohos-googletest/ohos-googletest_git.bb index 05fa6b6b..b89dce97 100644 --- a/meta-ohos-acts/recipes-ohos-googletest/ohos-googletest/ohos-googletest_git.bb +++ b/meta-ohos-acts/recipes-ohos-googletest/ohos-googletest/ohos-googletest_git.bb @@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=cbbd27594afd089daa160d3a16dd515a \ file://googlemock/scripts/generator/LICENSE;md5=2c0b90db7465231447cf2dd2e8163333 \ file://googletest/LICENSE;md5=cbbd27594afd089daa160d3a16dd515a" -SRC_URI = "git://git.ostc-eu.org/OSTC/OHOS/components/staging/third_party_googletest.git;protocol=https;branch=ostc-next" +SRC_URI = "git://git.ostc-eu.org/OSTC/OHOS/components/staging/third_party_googletest.git;protocol=https;branch=ostc-next \ +file://googletest-gcc-11.patch" SRCREV = "54337710388898ae818bbc2c0e0457c9b86e335e" S = "${WORKDIR}/git" PV = "0.0+git${SRCPV}" -- GitLab