Skip to content

Commit

Permalink
fmt version up 7.1.3 -> 8.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
injae committed Sep 17, 2021
1 parent ac62407 commit 0355aff
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ find_cppkg(nlohmann_json 3.9.1 MODULE nlohmann_json::nlohmann_json TYPE lib OPT
find_cppkg(ryml 0.2.0 MODULE ryml::ryml TYPE lib OPTIONAL OFF)
find_cppkg(toml11 3.7.0 MODULE toml11::toml11 TYPE lib OPTIONAL OFF)
find_cppkg(yaml-cpp 0.6.3 MODULE yaml-cpp TYPE lib OPTIONAL OFF)
find_cppkg(fmt 7.1.3 MODULE fmt::fmt TYPE lib OPTIONAL OFF)
find_cppkg(fmt 8.0.1 MODULE fmt::fmt-header-only TYPE lib OPTIONAL OFF)
find_cppkg(magic_enum 0.7.3 MODULE magic_enum::magic_enum TYPE lib)
find_cppkg(nameof 0.10.0 MODULE nameof::nameof TYPE lib)

Expand Down
2 changes: 1 addition & 1 deletion cppm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
[dependencies]
nameof = { version="0.10.0", link="public"}
magic_enum = { version= "0.7.3", link="public"}
fmt = {version="7.1.3", link="public", optional=true}
fmt = {version="8.0.1", link="public", optional=true}
yaml-cpp = { version="0.6.3", link="public", optional=true}
toml11 = { version="3.7.0", link="public", optional=true}
ryml = { version= "0.2.0", link="public", optional=true}
Expand Down
1 change: 0 additions & 1 deletion examples/parse_file.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "serdepp/serde.hpp"

#include "serdepp/adaptor/nlohmann_json.hpp"
#include "serdepp/adaptor/rapidjson.hpp"
#include "serdepp/adaptor/toml11.hpp"
Expand Down
22 changes: 11 additions & 11 deletions include/serdepp/adaptor/fmt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
template <typename T>
struct fmt::formatter<T, std::enable_if_t<serde::type::is_struct_v<T>, char>>
: fmt::formatter<std::string> {
template <typename format_ctx>
auto format(const T& serde_type, format_ctx& ctx) {
return formatter<std::string>::format(serde::to_string(serde_type), ctx);
}
};

template<>
struct fmt::formatter<serde::serde_sstream> : fmt::formatter<std::string> {
template <typename format_ctx>
auto format(const serde::serde_sstream& serde_type, format_ctx& ctx) {
return formatter<std::string>::format(serde_type.str(), ctx);
template <typename FormatCtx>
auto format(const T& serde_type, FormatCtx& ctx) {
return fmt::formatter<std::string>::format(serde::to_string(serde_type), ctx);
}
};
//
//template<>
//struct fmt::formatter<serde::serde_sstream> : fmt::formatter<std::string> {
// template <typename FormatCtx>
// auto format(const serde::serde_sstream& serde_type, FormatCtx& ctx) {
// return fmt::formatter<std::string>::format(serde_type.str(), ctx);
// }
//};

#endif
2 changes: 1 addition & 1 deletion thirdparty/fmt/8.0.1/cppkg.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[fmt]
version = "8.0.1"
description = "A modern formatting library"
module = "fmt::fmt"
module = "fmt::fmt-header-only"
url="https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip"
flags="-DFMT_DOC=OFF -DFMT_TEST=OFF"
4 changes: 2 additions & 2 deletions thirdparty/fmt/8.0.1/fmt.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.6)
project(fmt-8.0.1-install)

set(CPPM_VERSION 0.0.13)
set(CPPM_VERSION ${CPPM_VERSION})
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cppm_loader.cmake)
download_package(fmt 8.0.1 URL https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip TYPE lib CMAKE_ARGS ${CMAKE_ARGS} -DFMT_DOC=OFF -DFMT_TEST=OFF -DFMT_FUZZ=OFF)
download_package(fmt 8.0.1 URL https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip TYPE lib CMAKE_ARGS ${CMAKE_ARGS} -DFMT_DOC=OFF -DFMT_TEST=OFF)

0 comments on commit 0355aff

Please sign in to comment.