mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-24 05:14:40 -04:00
get it working on fmtlib 10.1.1
This commit is contained in:
parent
6f66e47bed
commit
953e9504a0
2 changed files with 5 additions and 5 deletions
|
@ -81,8 +81,7 @@ if (PROJECT_IS_TOP_LEVEL AND NOT GEODE_BUILDING_DOCS)
|
|||
set(MAT_JSON_AS_INTERFACE ON)
|
||||
endif()
|
||||
CPMAddPackage("gh:geode-sdk/json#a47f570")
|
||||
# be careful before updating this! see Log.hpp
|
||||
CPMAddPackage("gh:fmtlib/fmt#10.0.0")
|
||||
CPMAddPackage("gh:fmtlib/fmt#10.1.1")
|
||||
CPMAddPackage("gh:gulrak/filesystem#3e5b930")
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} INTERFACE MAT_JSON_DYNAMIC=1)
|
||||
|
|
|
@ -23,8 +23,7 @@ namespace geode {
|
|||
namespace geode::log::impl {
|
||||
// What is this all for? well, fmtlib disallows writing custom formatters for non-void pointer types.
|
||||
// So instead, we just wrap everything and pass it a string instead.
|
||||
// WARNING: This code breaks in fmtlib 10.1.1! I have no idea why, so be careful before updating it.
|
||||
|
||||
|
||||
template <class T>
|
||||
GEODE_INLINE GEODE_HIDDEN decltype(auto) wrapCocosObj(T&& value) {
|
||||
if constexpr (std::is_pointer_v<std::decay_t<T>> && requires(T ptr) { geode::format_as(ptr); }) {
|
||||
|
@ -76,7 +75,9 @@ namespace geode {
|
|||
|
||||
template <typename... Args>
|
||||
inline void logImpl(Severity severity, Mod* mod, impl::FmtStr<Args...> str, Args&&... args) {
|
||||
vlogImpl(severity, mod, str, fmt::make_format_args(impl::wrapCocosObj(args)...));
|
||||
[&]<typename... Ts>(Ts&&... args) {
|
||||
vlogImpl(severity, mod, str, fmt::make_format_args(args...));
|
||||
}(impl::wrapCocosObj(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue