From ca747c75724a26015a4d31d93c948fe62bf39228 Mon Sep 17 00:00:00 2001 From: cookcocck Date: Tue, 14 Jun 2022 11:12:49 +0800 Subject: [PATCH] Set c++20 when SPDLOG_USE_STD_FORMAT option is turned on --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3edf3af..28541a56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,11 @@ 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 # ---------------------------------------------------------------------------------------