From da0a748ac04f71fc99e6dcf85f83a85e160c660d Mon Sep 17 00:00:00 2001 From: Wang Mingyu Date: Tue, 16 May 2023 16:13:32 +0800 Subject: [PATCH] spdlog: fix build error for master fmt error message: include/spdlog/common.h:168:111: error: 'basic_runtime' is not a member of 'fmt' Add fix-build-for-master-fmt.patch: * update fmt_runtime_string macro * fix build of updated macro Signed-off-by: Wang Mingyu Signed-off-by: Khem Raj --- .../spdlog/fix-build-for-master-fmt.patch | 44 +++++++++++++++++++ .../recipes-support/spdlog/spdlog_1.11.0.bb | 1 + 2 files changed, 45 insertions(+) create mode 100644 meta-oe/recipes-support/spdlog/spdlog/fix-build-for-master-fmt.patch diff --git a/meta-oe/recipes-support/spdlog/spdlog/fix-build-for-master-fmt.patch b/meta-oe/recipes-support/spdlog/spdlog/fix-build-for-master-fmt.patch new file mode 100644 index 0000000000..c767db919f --- /dev/null +++ b/meta-oe/recipes-support/spdlog/spdlog/fix-build-for-master-fmt.patch @@ -0,0 +1,44 @@ +Upstream-Status: Backport +[https://github.com/gabime/spdlog/commit/0ca574ae168820da0268b3ec7607ca7b33024d05] + +Signed-off-by: Wang Mingyu + +From 0ca574ae168820da0268b3ec7607ca7b33024d05 Mon Sep 17 00:00:00 2001 +From: H1X4 <10332146+H1X4Dev@users.noreply.github.com> +Date: Fri, 31 Mar 2023 20:39:32 +0300 +Subject: [PATCH] fix build for master fmt (non-bundled) (#2694) + +* fix build for master fmt (non-bundled) + +* update fmt_runtime_string macro + +* fix build of updated macro +--- + include/spdlog/common.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/include/spdlog/common.h b/include/spdlog/common.h +index e69201a81..5f671c5c6 100644 +--- a/include/spdlog/common.h ++++ b/include/spdlog/common.h +@@ -173,12 +173,19 @@ using format_string_t = fmt::format_string; + template + using remove_cvref_t = typename std::remove_cv::type>::type; + ++template ++#if FMT_VERSION >= 90101 ++using fmt_runtime_string = fmt::runtime_format_string; ++#else ++using fmt_runtime_string = fmt::basic_runtime; ++#endif ++ + // clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here, + // in addition, fmt::basic_runtime is only convertible to basic_format_string but not basic_string_view + template + struct is_convertible_to_basic_format_string + : std::integral_constant>::value || std::is_same, fmt::basic_runtime>::value> ++ std::is_convertible>::value || std::is_same, fmt_runtime_string>::value> + {}; + + # if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) diff --git a/meta-oe/recipes-support/spdlog/spdlog_1.11.0.bb b/meta-oe/recipes-support/spdlog/spdlog_1.11.0.bb index ec985fb039..2800be4784 100644 --- a/meta-oe/recipes-support/spdlog/spdlog_1.11.0.bb +++ b/meta-oe/recipes-support/spdlog/spdlog_1.11.0.bb @@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ad SRCREV = "ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36" SRC_URI = "git://github.com/gabime/spdlog.git;protocol=https;branch=v1.x \ file://0001-Do-not-use-LFS64-functions-on-linux-musl.patch \ + file://fix-build-for-master-fmt.patch \ " DEPENDS += "fmt"