Set C++ standard to 20 if not defined (#3583)

Why? to be able to use a greater c++ when using conan.

Because conan reports: Warning: Standard CMAKE_CXX_STANDARD value defined in conan_toolchain.cmake to 23 has been modified to 20 by .conan2/p/b/spdlo815dcec129526/b/src/CMakeLists.txt
This commit is contained in:
Loïc Lopez
2026-04-09 09:07:23 +02:00
committed by GitHub
parent fb1227486b
commit 75e93f4bdd

View File

@@ -30,7 +30,9 @@ endif()
# Compiler config
# ---------------------------------------------------------------------------------------
if(SPDLOG_USE_STD_FORMAT)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
elseif(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)