From 8d63aa9521b9cead5481e36ba606d2dfba2dcee3 Mon Sep 17 00:00:00 2001
From: Pete Peterson <petersonpf@ornl.gov>
Date: Wed, 11 Jul 2018 12:15:10 -0400
Subject: [PATCH] Move declaration of c++14 standard

---
 buildconfig/CMake/CommonSetup.cmake | 6 ++++++
 buildconfig/CMake/GNUSetup.cmake    | 5 +----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/buildconfig/CMake/CommonSetup.cmake b/buildconfig/CMake/CommonSetup.cmake
index c86986e03a0..2f3fdf48352 100644
--- a/buildconfig/CMake/CommonSetup.cmake
+++ b/buildconfig/CMake/CommonSetup.cmake
@@ -241,6 +241,12 @@ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
   include ( LinuxSetup )
 endif ()
 
+###########################################################################
+# Set the c++ standard to 14 - cmake should do the right thing with msvc
+###########################################################################
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
 ###########################################################################
 # Add compiler options if using gcc
 ###########################################################################
diff --git a/buildconfig/CMake/GNUSetup.cmake b/buildconfig/CMake/GNUSetup.cmake
index 1ef72fafd24..ebb044b0372 100644
--- a/buildconfig/CMake/GNUSetup.cmake
+++ b/buildconfig/CMake/GNUSetup.cmake
@@ -96,10 +96,7 @@ if(WITH_UBSAN)
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SAN_FLAGS}" )
 endif()
 
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
-# XCode isn't picking up the standard set above.
+# XCode isn't picking up the c++ standard by CMAKE_CXX_STANDARD
 if(CMAKE_GENERATOR STREQUAL Xcode)
   set ( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS "${GNUFLAGS} -Woverloaded-virtual -fno-operator-names")
   set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14")
-- 
GitLab