setting the cmake standard to 20 when using std format (#2680)

This commit is contained in:
Bailey Chittle 2023-03-21 14:23:14 -04:00 committed by GitHub
parent 706ad70591
commit 040874224b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,10 @@ endif()
# ---------------------------------------------------------------------------------------
# Compiler config
# ---------------------------------------------------------------------------------------
if(NOT CMAKE_CXX_STANDARD)
if(SPDLOG_USE_STD_FORMAT)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
elseif(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
@ -256,11 +259,6 @@ if(SPDLOG_NO_EXCEPTIONS AND NOT MSVC)
target_compile_options(spdlog PRIVATE -fno-exceptions)
endif()
if(SPDLOG_USE_STD_FORMAT)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
# ---------------------------------------------------------------------------------------
# Build binaries
# ---------------------------------------------------------------------------------------