Use the old -std=c++0x flag for compatibility with pre-2011 versions of GCC.

llvm-svn: 152355
This commit is contained in:
Benjamin Kramer 2012-03-09 00:23:07 +00:00
parent e83bc02b16
commit 398ecd6200
1 changed files with 4 additions and 4 deletions

View File

@ -65,12 +65,12 @@ endif()
#
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++11" SUPPORTS_CXX11_FLAG)
check_cxx_compiler_flag("-std=c++0x" SUPPORTS_CXX11_FLAG)
if( SUPPORTS_CXX11_FLAG )
message(STATUS "Building with -std=c++11")
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
message(STATUS "Building with -std=c++0x")
set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
else( SUPPORTS_CXX11_FLAG )
message(WARNING "-std=c++11 not supported.")
message(WARNING "-std=c++0x not supported.")
endif()