Automatically handle switch between standalone fmt, spdlog bundled fmt and no fmt
This commit is contained in:
@@ -12,7 +12,14 @@
|
||||
#include <regex>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#if __has_include("fmt/format.h")
|
||||
#include <fmt/format.h>
|
||||
#elif __has_include("spdlog/fmt/fmt.h")
|
||||
#include <spdlog/fmt/fmt.h>
|
||||
#else
|
||||
#warning "Failed to find fmt include"
|
||||
#define OVKMBS_FMT_MISSING
|
||||
#endif
|
||||
#include <magic_enum.hpp>
|
||||
|
||||
namespace openVulkanoCpp
|
||||
@@ -154,6 +161,7 @@ namespace openVulkanoCpp
|
||||
inline constexpr ByteSize operator"" _EB(unsigned long long int num) { return { num, ByteSizeUnit::EB }; }
|
||||
}
|
||||
|
||||
#ifndef OVKMBS_FMT_MISSING
|
||||
template<> struct fmt::formatter<openVulkanoCpp::ByteSize>
|
||||
{
|
||||
template<typename ParseContext> constexpr auto parse(ParseContext& ctx)
|
||||
@@ -165,4 +173,5 @@ template<> struct fmt::formatter<openVulkanoCpp::ByteSize>
|
||||
{
|
||||
return format_to(ctx.out(), "{}", bs.Format());
|
||||
}
|
||||
};
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user