From 7b871e97fc7656a9d433eb2f4cbfdf039825650e Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Mon, 16 Aug 2021 18:44:42 -0300 Subject: [PATCH] Add fmtlib::fmt backport of C++20 std::format Because I'm tired of waiting for std::format. --- .gitmodules | 3 +++ external/CMakeLists.txt | 1 + src/common/CMakeLists.txt | 1 + src/daemon/rpc_command_executor.cpp | 5 +++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index b050db35b..4ff361f19 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index efd262424..abbb83e4c 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -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 diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index f0b266501..8aba55bfe 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -68,6 +68,7 @@ target_link_libraries(common filesystem fmt::fmt date::date + fmt::fmt PRIVATE libunbound OpenSSL::SSL diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 6487dfc39..83ff3216a 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -659,8 +660,8 @@ bool rpc_command_executor::print_connections() { info["current_download"].get() / 1000., info["avg_upload"].get() / 1000., info["current_upload"].get() / 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;