mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-27 16:09:05 +08:00
Use fmt only if not SPDLOG_USE_STD_FORMAT is ON
This commit is contained in:
parent
15ee3f7999
commit
d0c30a6a5c
@ -93,6 +93,10 @@ if(SPDLOG_USE_STD_FORMAT AND CMAKE_CXX_STANDARD LESS 20)
|
||||
message(FATAL_ERROR "SPDLOG_USE_STD_FORMAT must be used with CMAKE_CXX_STANDARD >= 20")
|
||||
endif()
|
||||
|
||||
if(SPDLOG_USE_STD_FORMAT AND SPDLOG_FMT_EXTERNAL)
|
||||
message(FATAL_ERROR "SPDLOG_USE_STD_FORMAT and SPDLOG_FMT_EXTERNAL are mutually exclusive")
|
||||
endif()
|
||||
|
||||
# misc tweakme options
|
||||
if(WIN32)
|
||||
option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF)
|
||||
@ -128,11 +132,13 @@ if(SPDLOG_BUILD_PIC)
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT SPDLOG_USE_STD_FORMAT)
|
||||
if (SPDLOG_FMT_EXTERNAL)
|
||||
find_package(fmt REQUIRED)
|
||||
else()
|
||||
include(cmake/fmtlib.cmake)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
|
||||
@ -256,7 +262,9 @@ endif()
|
||||
target_include_directories(spdlog ${SPDLOG_INCLUDES_LEVEL} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
|
||||
target_link_libraries(spdlog PUBLIC Threads::Threads)
|
||||
if(NOT SPDLOG_USE_STD_FORMAT)
|
||||
target_link_libraries(spdlog PUBLIC fmt::fmt)
|
||||
endif()
|
||||
spdlog_enable_warnings(spdlog)
|
||||
set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION
|
||||
${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR})
|
||||
|
Loading…
Reference in New Issue
Block a user