From 8b244ca988570bc7f01d5a2c682cde0bce013784 Mon Sep 17 00:00:00 2001 From: gabime Date: Sun, 12 May 2019 00:43:58 +0300 Subject: [PATCH] Moved format.cpp into spdlog.cpp - this way only one src file is needed --- CMakeLists.txt | 2 +- include/spdlog/common.h | 1 - src/format.cpp | 51 ----------------------------------------- src/spdlog.cpp | 51 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 53 deletions(-) delete mode 100644 src/format.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b2775b0..1a82606d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ message(STATUS "Static lib: " ${SPDLOG_STATIC_LIB}) if(SPDLOG_STATIC_LIB) add_definitions(-DSPDLOG_STATIC_LIB) set(SRC_BASE "${CMAKE_CURRENT_SOURCE_DIR}/src") - set(SRC_FILES "${SRC_BASE}/spdlog.cpp" "${SRC_BASE}/format.cpp") + set(SRC_FILES "${SRC_BASE}/spdlog.cpp") add_library(spdlog STATIC ${SRC_FILES}) target_include_directories(spdlog PUBLIC "$") target_link_libraries(spdlog -Wl,--as-needed) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index d885ac61..819f3abb 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -19,7 +19,6 @@ #include #endif - #ifdef SPDLOG_STATIC_LIB #undef SPDLOG_HEADER_ONLY #define SPDLOG_INLINE diff --git a/src/format.cpp b/src/format.cpp deleted file mode 100644 index 0a98d58b..00000000 --- a/src/format.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2012 - 2016, Victor Zverovich -// All rights reserved. -// -// For the license information refer to format.h. - -// Slightly modified version of fmt lib to include bundled format-inl.h - -#if !defined(SPDLOG_FMT_EXTERNAL) -#include "spdlog/fmt/bundled/format-inl.h" -#else -#include "fmt/format-inl.h" -#endif - -FMT_BEGIN_NAMESPACE -template struct internal::basic_data; -template FMT_API internal::locale_ref::locale_ref(const std::locale &loc); -template FMT_API std::locale internal::locale_ref::get() const; - -// Explicit instantiations for char. - -template FMT_API char internal::thousands_sep_impl(locale_ref); - -template FMT_API void internal::basic_buffer::append(const char *, const char *); - -template FMT_API void internal::arg_map::init(const basic_format_args &args); - -template FMT_API int internal::char_traits::format_float(char *, std::size_t, const char *, int, double); - -template FMT_API int internal::char_traits::format_float(char *, std::size_t, const char *, int, long double); - -template FMT_API std::string internal::vformat(string_view, basic_format_args); - -template FMT_API format_context::iterator internal::vformat_to(internal::buffer &, string_view, basic_format_args); - -template FMT_API void internal::sprintf_format(double, internal::buffer &, core_format_specs); -template FMT_API void internal::sprintf_format(long double, internal::buffer &, core_format_specs); - -// Explicit instantiations for wchar_t. - -template FMT_API wchar_t internal::thousands_sep_impl(locale_ref); - -template FMT_API void internal::basic_buffer::append(const wchar_t *, const wchar_t *); - -template FMT_API void internal::arg_map::init(const basic_format_args &); - -template FMT_API int internal::char_traits::format_float(wchar_t *, std::size_t, const wchar_t *, int, double); - -template FMT_API int internal::char_traits::format_float(wchar_t *, std::size_t, const wchar_t *, int, long double); - -template FMT_API std::wstring internal::vformat(wstring_view, basic_format_args); -FMT_END_NAMESPACE diff --git a/src/spdlog.cpp b/src/spdlog.cpp index 7c75ca31..9052bc2a 100644 --- a/src/spdlog.cpp +++ b/src/spdlog.cpp @@ -56,3 +56,54 @@ template class spdlog::sinks::ansicolor_sink; +template FMT_API internal::locale_ref::locale_ref(const std::locale &loc); +template FMT_API std::locale internal::locale_ref::get() const; + +// Explicit instantiations for char. + +template FMT_API char internal::thousands_sep_impl(locale_ref); + +template FMT_API void internal::basic_buffer::append(const char *, const char *); + +template FMT_API void internal::arg_map::init(const basic_format_args &args); + +template FMT_API int internal::char_traits::format_float(char *, std::size_t, const char *, int, double); + +template FMT_API int internal::char_traits::format_float(char *, std::size_t, const char *, int, long double); + +template FMT_API std::string internal::vformat(string_view, basic_format_args); + +template FMT_API format_context::iterator internal::vformat_to(internal::buffer &, string_view, basic_format_args); + +template FMT_API void internal::sprintf_format(double, internal::buffer &, core_format_specs); +template FMT_API void internal::sprintf_format(long double, internal::buffer &, core_format_specs); + +// Explicit instantiations for wchar_t. + +template FMT_API wchar_t internal::thousands_sep_impl(locale_ref); + +template FMT_API void internal::basic_buffer::append(const wchar_t *, const wchar_t *); + +template FMT_API void internal::arg_map::init(const basic_format_args &); + +template FMT_API int internal::char_traits::format_float(wchar_t *, std::size_t, const wchar_t *, int, double); + +template FMT_API int internal::char_traits::format_float(wchar_t *, std::size_t, const wchar_t *, int, long double); + +template FMT_API std::wstring internal::vformat(wstring_view, basic_format_args); +FMT_END_NAMESPACE