diff options
| author | Martin Jansa <martin.jansa@gmail.com> | 2025-03-21 15:30:22 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-03-21 11:07:34 -0700 |
| commit | 98f9507a73f015f24a9a01e716654524e848f9b1 (patch) | |
| tree | 5e2ef8f80e907aa94dc1ad3f8a9f08f95841e4b0 | |
| parent | 053d73ffd6d71a9c39602dff171c837af110e692 (diff) | |
| download | meta-openembedded-98f9507a73f015f24a9a01e716654524e848f9b1.tar.gz | |
googletest: fix build with gcc-15
* some recipes which use googletest fail with:
gtest/src/gtest_main.cc:32: recipe-sysroot/usr/include/c++/15.0.1/ciso646:46:4: error: #warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros" [-Werror=cpp]
46 | # warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros"
| ^~~~~~~
backport a fix for this.
* see https://github.com/google/googletest/issues/4701
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-test/googletest/googletest/gtest-ciso646.patch | 26 | ||||
| -rw-r--r-- | meta-oe/recipes-test/googletest/googletest_1.16.0.bb | 4 |
2 files changed, 29 insertions, 1 deletions
diff --git a/meta-oe/recipes-test/googletest/googletest/gtest-ciso646.patch b/meta-oe/recipes-test/googletest/googletest/gtest-ciso646.patch new file mode 100644 index 0000000000..814912650b --- /dev/null +++ b/meta-oe/recipes-test/googletest/googletest/gtest-ciso646.patch | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | https://github.com/google/googletest/issues/4701 | ||
| 2 | |||
| 3 | taken from fedora: | ||
| 4 | https://src.fedoraproject.org/rpms/gtest/c/b3fe6f803a1e554971f70e1c3f55aa5fcb377b1b?branch=rawhide | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
| 8 | |||
| 9 | --- ./googletest/include/gtest/internal/gtest-port.h.orig 2025-01-27 03:39:18.963893931 +0000 | ||
| 10 | +++ ./googletest/include/gtest/internal/gtest-port.h 2025-01-28 13:57:51.381081952 +0000 | ||
| 11 | @@ -288,11 +288,11 @@ | ||
| 12 | |||
| 13 | // Detect C++ feature test macros as gracefully as possible. | ||
| 14 | // MSVC >= 19.15, Clang >= 3.4.1, and GCC >= 4.1.2 support feature test macros. | ||
| 15 | -#if GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L && \ | ||
| 16 | - (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE(<version>)) | ||
| 17 | +#if GTEST_INTERNAL_HAS_INCLUDE(<version>) || \ | ||
| 18 | + (GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L && !defined(__has_include)) | ||
| 19 | #include <version> // C++20 and later | ||
| 20 | -#elif (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE(<ciso646>)) | ||
| 21 | -#include <ciso646> // Pre-C++20 | ||
| 22 | +#else | ||
| 23 | +#include <cerrno> // Pre-C++20 | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #include <ctype.h> // for isspace, etc | ||
diff --git a/meta-oe/recipes-test/googletest/googletest_1.16.0.bb b/meta-oe/recipes-test/googletest/googletest_1.16.0.bb index cc2e8e3c94..fe2f732a5d 100644 --- a/meta-oe/recipes-test/googletest/googletest_1.16.0.bb +++ b/meta-oe/recipes-test/googletest/googletest_1.16.0.bb | |||
| @@ -8,7 +8,9 @@ PROVIDES += "gmock gtest" | |||
| 8 | 8 | ||
| 9 | S = "${WORKDIR}/git" | 9 | S = "${WORKDIR}/git" |
| 10 | SRCREV = "6910c9d9165801d8827d628cb72eb7ea9dd538c5" | 10 | SRCREV = "6910c9d9165801d8827d628cb72eb7ea9dd538c5" |
| 11 | SRC_URI = "git://github.com/google/googletest.git;branch=v1.16.x;protocol=https" | 11 | SRC_URI = "git://github.com/google/googletest.git;branch=v1.16.x;protocol=https \ |
| 12 | file://gtest-ciso646.patch \ | ||
| 13 | " | ||
| 12 | 14 | ||
| 13 | inherit cmake pkgconfig | 15 | inherit cmake pkgconfig |
| 14 | 16 | ||
