From 1fff9ce35e643a201e9594bf2001cfaa966e2286 Mon Sep 17 00:00:00 2001 From: Matt Kopec Date: Thu, 21 Mar 2013 20:52:53 +0000 Subject: [PATCH] Select correct -std flag for CMake for different versions of gcc. llvm-svn: 177663 --- lldb/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index d5a28ea..aa41e9a 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -82,7 +82,16 @@ endmacro(add_lldb_definitions) include_directories(/usr/include/python2.7) include_directories(../clang/include) include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include") -set(CMAKE_CXX_FLAGS "-std=c++11") + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7") + set(CMAKE_CXX_FLAGS "-std=c++0x") + else() + set(CMAKE_CXX_FLAGS "-std=c++11") + endif() +else() + set(CMAKE_CXX_FLAGS "-std=c++11") +endif() # Disable MSVC warnings if( MSVC ) -- 2.7.4