From e99759fe45685355200ad4ed5b5b43150ac60a15 Mon Sep 17 00:00:00 2001 From: shimaowo <45767709+shimaowo@users.noreply.github.com> Date: Fri, 18 Dec 2020 14:31:34 -0800 Subject: [PATCH] Fix #1765 - Add SPDLOG_DISABLE_DEFAULT_LOGGER as a cmake option --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b98f5509..4ee66976 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,7 @@ option( SPDLOG_NO_ATOMIC_LEVELS "prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently" OFF) +option(SPDLOG_DISABLE_DEFAULT_LOGGER "Disable default logger creation" OFF) # clang-tidy if(${CMAKE_VERSION} VERSION_GREATER "3.5") @@ -201,7 +202,8 @@ foreach( SPDLOG_PREVENT_CHILD_FD SPDLOG_NO_THREAD_ID SPDLOG_NO_TLS - SPDLOG_NO_ATOMIC_LEVELS) + SPDLOG_NO_ATOMIC_LEVELS + SPDLOG_DISABLE_DEFAULT_LOGGER) if(${SPDLOG_OPTION}) target_compile_definitions(spdlog PUBLIC ${SPDLOG_OPTION}) target_compile_definitions(spdlog_header_only INTERFACE ${SPDLOG_OPTION})