2
0
Эх сурвалжийг харах

[spdlog] Add `fmt10` patch (#2089)

* [spdlog] Add `fmt10` patch

* [spdlog] Fix patch?
Qudix 2 жил өмнө
parent
commit
6d67e51744

+ 25 - 0
packages/s/spdlog/patches/v1.11.0/fmt10.patch

@@ -0,0 +1,25 @@
+diff --git a/include/spdlog/common.h b/include/spdlog/common.h
+index f97fd48c..e40e7591 100644
+--- a/include/spdlog/common.h
++++ b/include/spdlog/common.h
+@@ -160,12 +160,19 @@ using format_string_t = fmt::format_string<Args...>;
+ template<class T>
+ using remove_cvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
+ 
++template <typename Char>
++#if FMT_VERSION >= 90101
++using fmt_runtime_string = fmt::runtime_format_string<Char>;
++#else
++using fmt_runtime_string = fmt::basic_runtime<Char>;
++#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<Char> is only convertible to basic_format_string<Char> but not basic_string_view<Char>
+ template<class T, class Char = char>
+ struct is_convertible_to_basic_format_string
+     : std::integral_constant<bool,
+-          std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt::basic_runtime<Char>>::value>
++          std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt_runtime_string<Char>>::value>
+ {};
+ 
+ #    if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)

+ 2 - 0
packages/s/spdlog/xmake.lua

@@ -18,6 +18,8 @@ package("spdlog")
     add_versions("v1.4.2", "56b90f0bd5b126cf1b623eeb19bf4369516fa68f036bbc22d9729d2da511fb5a")
     add_versions("v1.4.2", "56b90f0bd5b126cf1b623eeb19bf4369516fa68f036bbc22d9729d2da511fb5a")
     add_versions("v1.3.1", "db6986d0141546d4fba5220944cc1f251bd8afdfc434bda173b4b0b6406e3cd0")
     add_versions("v1.3.1", "db6986d0141546d4fba5220944cc1f251bd8afdfc434bda173b4b0b6406e3cd0")
 
 
+    add_patches("v1.11.0", path.join(os.scriptdir(), "patches", "v1.11.0", "fmt10.patch"), "61efa804845141ffa86532d9be7103d4dc8185e96de69d5efca42ebd7058e13d")
+
     add_configs("header_only",     {description = "Use header only version.", default = true, type = "boolean"})
     add_configs("header_only",     {description = "Use header only version.", default = true, type = "boolean"})
     add_configs("std_format",      {description = "Use std::format instead of fmt library.", default = false, type = "boolean"})
     add_configs("std_format",      {description = "Use std::format instead of fmt library.", default = false, type = "boolean"})
     add_configs("fmt_external",    {description = "Use external fmt library instead of bundled.", default = false, type = "boolean"})
     add_configs("fmt_external",    {description = "Use external fmt library instead of bundled.", default = false, type = "boolean"})