Specify which default log level to use depending on CMake build type

This commit is contained in:
Morgan Funtowicz 2024-07-08 22:06:49 +00:00
parent 4113d6d51b
commit f53ffa886d
1 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,12 @@
set(SPDLOG_USE_FMT ON)
# Define the level at which SPDLOG_ compilation level is defined
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_compile_definitions(SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG)
else()
add_compile_definitions(SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO)
endif()
fetchcontent_declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git