From ebaa16f403db02d847feb6a6a9c926bad5dd77be Mon Sep 17 00:00:00 2001 From: gabime Date: Thu, 12 Dec 2019 23:52:22 +0200 Subject: [PATCH] CMakeLists.txt allow overriding the cpp standard to higher than 11 --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 260f8ae2..508a0b65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,8 +25,11 @@ message(STATUS "Build spdlog: ${SPDLOG_VERSION}") #--------------------------------------------------------------------------------------- # Compiler config #--------------------------------------------------------------------------------------- -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +if (NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + set(CMAKE_CXX_EXTENSIONS OFF) if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")