From 1f6025dc0553c64eb556759a38ff70e55f97904b Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Thu, 26 Jan 2023 20:10:42 -0500
Subject: [PATCH] Switch CMake build system from C++11 to C++14

---
 CMakeLists.txt | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 538cc8a..ed42915 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,21 +2,21 @@ cmake_minimum_required(VERSION 2.8.7)
 
 project(Easyloggingpp CXX)
 
-macro(require_cpp11)
+macro(require_cpp14)
         if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0)
                 # CMake 3.1 has built-in CXX standard checks.
-                message("-- Setting C++11")
-                set(CMAKE_CXX_STANDARD 11)
+                message("-- Setting C++14")
+                set(CMAKE_CXX_STANDARD 14)
                 set(CMAKE_CXX_STANDARD_REQUIRED on)
         else()
                 if (CMAKE_CXX_COMPILER_ID MATCHES "GCC")
-                    message ("-- GNU CXX (-std=c++11)")
-                    list(APPEND CMAKE_CXX_FLAGS "-std=c++11")
+                    message ("-- GNU CXX (-std=c++14)")
+                    list(APPEND CMAKE_CXX_FLAGS "-std=c++14")
                 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-                    message ("-- CLang CXX (-std=c++11)")
-                    list(APPEND CMAKE_CXX_FLAGS "-std=c++11")
+                    message ("-- CLang CXX (-std=c++14)")
+                    list(APPEND CMAKE_CXX_FLAGS "-std=c++14")
                 else()
-                    message ("-- Easylogging++ requires C++11. Your compiler does not support it.")
+                    message ("-- Easylogging++ requires C++14. Your compiler does not support it.")
                 endif()
         endif()
 endmacro()
@@ -57,7 +57,7 @@ if (build_static_lib)
                 add_definitions(-DELPP_UTC_DATETIME)
         endif()
 
-        require_cpp11()
+        require_cpp14()
         add_library(easyloggingpp STATIC src/easylogging++.cc)
         set_property(TARGET easyloggingpp PROPERTY POSITION_INDEPENDENT_CODE ON)
 
@@ -71,8 +71,8 @@ export(PACKAGE ${PROJECT_NAME})
 
 ########################################## Unit Testing ###################################
 if (test)
-    # We need C++11
-    require_cpp11()
+    # We need C++14
+    require_cpp14()
     set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
 
     find_package (gtest REQUIRED)
-- 
2.39.1

