Changed: Use CPP11 everywhere if supported

--HG--
branch : develop
This commit is contained in:
kervala 2018-07-10 17:02:42 +02:00
parent 1f897f6106
commit 4444e93bf7
2 changed files with 5 additions and 3 deletions

View file

@ -209,8 +209,8 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0") IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION)
LIST(APPEND _FLAGS "-std=gnu++11") LIST(APPEND _FLAGS ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION})
ENDIF() ENDIF()
# Format definitions # Format definitions

View file

@ -874,7 +874,9 @@ MACRO(NL_SETUP_BUILD)
ENDIF() ENDIF()
# use c++0x standard to use std::unique_ptr and std::shared_ptr # 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") ADD_PLATFORM_FLAGS("-D_REENTRANT")