From 4444e93bf7b0380ba915780cd68c48a97d2d4f9b Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 10 Jul 2018 17:02:42 +0200 Subject: [PATCH] Changed: Use CPP11 everywhere if supported --HG-- branch : develop --- code/CMakeModules/PCHSupport.cmake | 4 ++-- code/CMakeModules/nel.cmake | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index c396bd6cf..24b4d5a85 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -209,8 +209,8 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) ENDIF() ENDIF() - IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0") - LIST(APPEND _FLAGS "-std=gnu++11") + IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION) + LIST(APPEND _FLAGS ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}) ENDIF() # Format definitions diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 95b28bb8a..6b5b36745 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -874,7 +874,9 @@ MACRO(NL_SETUP_BUILD) ENDIF() # use c++0x standard to use std::unique_ptr and std::shared_ptr - SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -std=c++0x") + IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION) + SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}") + ENDIF() ADD_PLATFORM_FLAGS("-D_REENTRANT")