mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-28 00:10:21 +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")
|
message(FATAL_ERROR "SPDLOG_USE_STD_FORMAT must be used with CMAKE_CXX_STANDARD >= 20")
|
||||||
endif()
|
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
|
# misc tweakme options
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF)
|
option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF)
|
||||||
@ -128,10 +132,12 @@ if(SPDLOG_BUILD_PIC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if (SPDLOG_FMT_EXTERNAL)
|
if(NOT SPDLOG_USE_STD_FORMAT)
|
||||||
find_package(fmt REQUIRED)
|
if (SPDLOG_FMT_EXTERNAL)
|
||||||
else()
|
find_package(fmt REQUIRED)
|
||||||
include(cmake/fmtlib.cmake)
|
else()
|
||||||
|
include(cmake/fmtlib.cmake)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
@ -256,7 +262,9 @@ endif()
|
|||||||
target_include_directories(spdlog ${SPDLOG_INCLUDES_LEVEL} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
|
target_include_directories(spdlog ${SPDLOG_INCLUDES_LEVEL} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
|
||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
|
||||||
target_link_libraries(spdlog PUBLIC Threads::Threads)
|
target_link_libraries(spdlog PUBLIC Threads::Threads)
|
||||||
target_link_libraries(spdlog PUBLIC fmt::fmt)
|
if(NOT SPDLOG_USE_STD_FORMAT)
|
||||||
|
target_link_libraries(spdlog PUBLIC fmt::fmt)
|
||||||
|
endif()
|
||||||
spdlog_enable_warnings(spdlog)
|
spdlog_enable_warnings(spdlog)
|
||||||
set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION
|
set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION
|
||||||
${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR})
|
${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR})
|
||||||
|
Loading…
Reference in New Issue
Block a user