From b2e484d9425dbc929d65d2fae2df2c382eba195a Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 30 Jul 2015 16:16:58 -0400 Subject: [PATCH] cmake: build as c++11 Signed-off-by: Casey Bodley --- src/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bad7147175c9d..e5970faecc539 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,6 +19,16 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic -Wall -Wtype-limits -Wignored-qual set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -ftemplate-depth-1024 -Wno-invalid-offsetof -Wnon-virtual-dtor -Wno-invalid-offsetof -Wstrict-null-sentinel -Woverloaded-virtual") +# require c++11 +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +if (COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +else() + message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.") +endif() + + set(EXTRALIBS uuid rt dl ${Boost_LIBS}) if(${WITH_PROFILER}) -- 2.39.5