mirror of
https://github.com/gabime/spdlog.git
synced 2025-04-01 02:42:41 +08:00
Fixed building under c++17
This commit is contained in:
parent
9ebc4b24d9
commit
68aed6a5eb
@ -235,24 +235,6 @@ if(SPDLOG_NO_EXCEPTIONS AND NOT MSVC)
|
|||||||
target_compile_options(spdlog PRIVATE -fno-exceptions)
|
target_compile_options(spdlog PRIVATE -fno-exceptions)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------------------
|
|
||||||
# Allow override of level names
|
|
||||||
# ---------------------------------------------------------------------------------------
|
|
||||||
set(SPDLOG_LEVEL_NAME_TRACE "trace" CACHE STRING "custom level name")
|
|
||||||
set(SPDLOG_LEVEL_NAME_DEBUG "debug" CACHE STRING "custom level name")
|
|
||||||
set(SPDLOG_LEVEL_NAME_INFO "info" CACHE STRING "custom level name")
|
|
||||||
set(SPDLOG_LEVEL_NAME_WARNING "warning" CACHE STRING "custom level name")
|
|
||||||
set(SPDLOG_LEVEL_NAME_ERROR "error" CACHE STRING "custom level name")
|
|
||||||
set(SPDLOG_LEVEL_NAME_CRITICAL "critical" CACHE STRING "custom level name")
|
|
||||||
set(SPDLOG_LEVEL_NAME_OFF "off" CACHE STRING "custom level name")
|
|
||||||
|
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_LEVEL_NAME_TRACE=\"${SPDLOG_LEVEL_NAME_TRACE}\")
|
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_LEVEL_NAME_DEBUG=\"${SPDLOG_LEVEL_NAME_DEBUG}\")
|
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_LEVEL_NAME_INFO=\"${SPDLOG_LEVEL_NAME_INFO}\")
|
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_LEVEL_NAME_WARNING=\"${SPDLOG_LEVEL_NAME_WARNING}\")
|
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_LEVEL_NAME_ERROR=\"${SPDLOG_LEVEL_NAME_ERROR}\")
|
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_LEVEL_NAME_CRITICAL=\"${SPDLOG_LEVEL_NAME_CRITICAL}\")
|
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_LEVEL_NAME_OFF=\"${SPDLOG_LEVEL_NAME_OFF}\")
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------------
|
||||||
# Build binaries
|
# Build binaries
|
||||||
|
@ -152,38 +152,19 @@ enum level_enum
|
|||||||
n_levels
|
n_levels
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(SPDLOG_LEVEL_NAME_TRACE)
|
#define SPDLOG_LEVEL_NAME_TRACE string_view_t("trace", 5)
|
||||||
#define SPDLOG_LEVEL_NAME_TRACE "trace"
|
#define SPDLOG_LEVEL_NAME_DEBUG string_view_t("debug", 5)
|
||||||
#endif
|
#define SPDLOG_LEVEL_NAME_INFO string_view_t("info", 4)
|
||||||
|
#define SPDLOG_LEVEL_NAME_WARNING string_view_t("warning", 7)
|
||||||
#if !defined(SPDLOG_LEVEL_NAME_DEBUG)
|
#define SPDLOG_LEVEL_NAME_ERROR string_view_t("error", 5)
|
||||||
#define SPDLOG_LEVEL_NAME_DEBUG "debug"
|
#define SPDLOG_LEVEL_NAME_CRITICAL string_view_t("critical", 8)
|
||||||
#endif
|
#define SPDLOG_LEVEL_NAME_OFF string_view_t("off", 3)
|
||||||
|
|
||||||
#if !defined(SPDLOG_LEVEL_NAME_INFO)
|
|
||||||
#define SPDLOG_LEVEL_NAME_INFO "info"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SPDLOG_LEVEL_NAME_WARNING)
|
|
||||||
#define SPDLOG_LEVEL_NAME_WARNING "warning"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SPDLOG_LEVEL_NAME_ERROR)
|
|
||||||
#define SPDLOG_LEVEL_NAME_ERROR "error"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SPDLOG_LEVEL_NAME_CRITICAL)
|
|
||||||
#define SPDLOG_LEVEL_NAME_CRITICAL "critical"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SPDLOG_LEVEL_NAME_OFF)
|
|
||||||
#define SPDLOG_LEVEL_NAME_OFF "off"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SPDLOG_LEVEL_NAMES)
|
#if !defined(SPDLOG_LEVEL_NAMES)
|
||||||
# define SPDLOG_LEVEL_NAMES \
|
# define SPDLOG_LEVEL_NAMES \
|
||||||
{ \
|
{ \
|
||||||
SPDLOG_LEVEL_NAME_TRACE, SPDLOG_LEVEL_NAME_DEBUG, SPDLOG_LEVEL_NAME_INFO, SPDLOG_LEVEL_NAME_WARNING, SPDLOG_LEVEL_NAME_ERROR, SPDLOG_LEVEL_NAME_CRITICAL, SPDLOG_LEVEL_NAME_OFF \
|
SPDLOG_LEVEL_NAME_TRACE, SPDLOG_LEVEL_NAME_DEBUG, SPDLOG_LEVEL_NAME_INFO, SPDLOG_LEVEL_NAME_WARNING, SPDLOG_LEVEL_NAME_ERROR, \
|
||||||
|
SPDLOG_LEVEL_NAME_CRITICAL, SPDLOG_LEVEL_NAME_OFF \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -275,4 +256,3 @@ std::unique_ptr<T> make_unique(Args &&...args)
|
|||||||
#ifdef SPDLOG_HEADER_ONLY
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
# include "common-inl.h"
|
# include "common-inl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -93,48 +93,6 @@
|
|||||||
// "MY ERROR", "MY CRITICAL", "OFF" }
|
// "MY ERROR", "MY CRITICAL", "OFF" }
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Uncomment to customize the trace level name
|
|
||||||
//
|
|
||||||
// #define SPDLOG_LEVEL_NAME_TRACE "MY TRACE"
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Uncomment to customize the debug level name
|
|
||||||
//
|
|
||||||
// #define SPDLOG_LEVEL_NAME_DEBUG "MY DEBUG"
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Uncomment to customize the info level name
|
|
||||||
//
|
|
||||||
// #define SPDLOG_LEVEL_NAME_INFO "MY INFO"
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Uncomment to customize the warning level name
|
|
||||||
//
|
|
||||||
// #define SPDLOG_LEVEL_NAME_WARNING "MY WARNING"
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Uncomment to customize the error level name
|
|
||||||
//
|
|
||||||
// #define SPDLOG_LEVEL_NAME_ERROR "MY ERROR"
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Uncomment to customize the critical level name
|
|
||||||
//
|
|
||||||
// #define SPDLOG_LEVEL_NAME_CRITICAL "MY CRITICAL"
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Uncomment to customize the off level name
|
|
||||||
//
|
|
||||||
// #define SPDLOG_LEVEL_NAME_OFF "MY OFF"
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Uncomment to customize short level names (e.g. "MT")
|
// Uncomment to customize short level names (e.g. "MT")
|
||||||
// These can be longer than one character.
|
// These can be longer than one character.
|
||||||
|
Loading…
Reference in New Issue
Block a user