Add fmtlib::fmt backport of C++20 std::format

Because I'm tired of waiting for std::format.
This commit is contained in:
Jason Rhinelander 2021-08-16 18:44:42 -03:00 committed by Thomas Winget
parent 60a4a868b4
commit 7b871e97fc
4 changed files with 8 additions and 2 deletions

3
.gitmodules vendored
View File

@ -40,3 +40,6 @@
[submodule "external/date"]
path = external/date
url = https://github.com/HowardHinnant/date.git
[submodule "external/fmt"]
path = external/fmt
url = https://github.com/fmtlib/fmt.git

View File

@ -85,6 +85,7 @@ add_subdirectory(easylogging++ easyloggingpp)
add_subdirectory(randomx EXCLUDE_FROM_ALL)
add_subdirectory(fmt)
add_subdirectory(date EXCLUDE_FROM_ALL)
add_subdirectory(fmt)
set(JSON_BuildTests OFF CACHE INTERNAL "")
set(JSON_MultipleHeaders ON CACHE BOOL "") # Allows multi-header nlohmann use

View File

@ -68,6 +68,7 @@ target_link_libraries(common
filesystem
fmt::fmt
date::date
fmt::fmt
PRIVATE
libunbound
OpenSSL::SSL

View File

@ -45,6 +45,7 @@
#include <oxenmq/base32z.h>
#include <fmt/core.h>
#include <date/date.h>
#include <fmt/core.h>
#include <fstream>
#include <ctime>
@ -659,8 +660,8 @@ bool rpc_command_executor::print_connections() {
info["current_download"].get<uint64_t>() / 1000.,
info["avg_upload"].get<uint64_t>() / 1000.,
info["current_upload"].get<uint64_t>() / 1000.,
(info.value("localhost", false) ? "[LOCALHOST]" : ""),
(info.value("local_ip", false) ? "[LAN]" : ""));
info.value("localhost", false) ? "[LOCALHOST]" : "",
info.value("local_ip", false) ? "[LAN]" : "");
}
return true;