diff --git a/CMakeLists.txt b/CMakeLists.txt index 95af3e53..21577e50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,7 +137,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) # --------------------------------------------------------------------------------------- # Static/Shared library (shared not supported in windows yet) # --------------------------------------------------------------------------------------- -set(SPDLOG_SRCS src/spdlog.cpp src/stdout_sinks.cpp src/color_sinks.cpp src/file_sinks.cpp src/registry.cpp src/async.cpp src/cfg.cpp) +set(SPDLOG_SRCS src/spdlog.cpp src/stdout_sinks.cpp src/color_sinks.cpp src/file_sinks.cpp src/async.cpp src/cfg.cpp) if(NOT SPDLOG_USE_STD_FORMAT AND NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO) list(APPEND SPDLOG_SRCS src/fmt.cpp) diff --git a/include/spdlog/details/registry-inl.h b/include/spdlog/details/registry-inl.h index 7f5e1925..56fdc44a 100644 --- a/include/spdlog/details/registry-inl.h +++ b/include/spdlog/details/registry-inl.h @@ -289,12 +289,14 @@ SPDLOG_INLINE void registry::set_levels(log_levels levels, level::level_enum *gl } #ifndef SPDLOG_COMPILED_LIB -SPDLOG_INLINE registry ®istry::instance() +SPDLOG_INLINE +#endif +registry ®istry::instance() { static registry s_instance; return s_instance; } -#endif + SPDLOG_INLINE void registry::throw_if_exists_(const std::string &logger_name) { diff --git a/src/registry.cpp b/src/registry.cpp deleted file mode 100644 index 29dd2c83..00000000 --- a/src/registry.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) - -#ifndef SPDLOG_COMPILED_LIB -# error Please define SPDLOG_COMPILED_LIB to compile this file. -#endif - -#include - -namespace spdlog { -namespace details { - -registry ®istry::instance() -{ - static registry s_instance; - return s_instance; -} - -} -}