From ba6099ec22b0198b4d5bc2a261ccb5110bbb5d08 Mon Sep 17 00:00:00 2001 From: Russell Taylor <taylorrj@ornl.gov> Date: Fri, 24 Feb 2012 16:53:07 -0500 Subject: [PATCH] Turn on the c++0x flag for the gcc & intel compilers. Re #4779. Allows use if c++11 features (if implemented across all supported compilers). --- Code/Mantid/Build/CMake/DarwinSetup.cmake | 2 +- Code/Mantid/Build/CMake/GNUSetup.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Mantid/Build/CMake/DarwinSetup.cmake b/Code/Mantid/Build/CMake/DarwinSetup.cmake index ed5570c510f..26f90ab36a1 100644 --- a/Code/Mantid/Build/CMake/DarwinSetup.cmake +++ b/Code/Mantid/Build/CMake/DarwinSetup.cmake @@ -25,7 +25,7 @@ endif () # Force 64-bit compiler as that's all we support ########################################################################### set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64" ) -set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64" ) +set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++0x" ) ########################################################################### # Mac-specific installation setup diff --git a/Code/Mantid/Build/CMake/GNUSetup.cmake b/Code/Mantid/Build/CMake/GNUSetup.cmake index 2029b54e3b3..bd4a79da3c8 100644 --- a/Code/Mantid/Build/CMake/GNUSetup.cmake +++ b/Code/Mantid/Build/CMake/GNUSetup.cmake @@ -12,7 +12,7 @@ STRING(REGEX REPLACE ".*([0-9]\\.[0-9]\\.[0-9]).*" "\\1" GCC_COMPILER_VERSION ${ MESSAGE(STATUS "gcc version: ${GCC_COMPILER_VERSION}") # Global warning flags. -set( GNUFLAGS "-Wall -Wextra -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) +set( GNUFLAGS "-Wall -Wextra -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -Woverloaded-virtual -fno-common" ) # Disable some warnings about deprecated headers and type conversions that # we can't do anything about # -Wno-deprecated: Do not warn about use of deprecated headers. @@ -22,16 +22,16 @@ set( GNUFLAGS "${GNUFLAGS} -Wno-deprecated -Wno-write-strings") # Check if we have a new enough version for this flag IF (GCC_COMPILER_VERSION VERSION_GREATER "4.3") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result") + set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result") ENDIF (GCC_COMPILER_VERSION VERSION_GREATER "4.3") # Add some options for debug build to help the Zoom profiler set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-omit-frame-pointer" ) set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer" ) -# Set the options fo gcc and g++ +# Set the options for gcc and g++ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GNUFLAGS}" ) -set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GNUFLAGS} -Woverloaded-virtual -fno-operator-names" ) +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GNUFLAGS} -fno-operator-names -std=c++0x" ) # Cleanup set ( GNUFLAGS ) -- GitLab