Always build in C++11 mode on GCC and Clang.

This will weed out compilers that are too old to build our code
(among others, recent gtkmm and glibmm have a hard dependency on
C++11, not even C++0x) and also properly communicate our wish to GCC
(Clang defaults to C++11 these days).
pull/4/head
whitequark 2016-02-15 19:58:03 +00:00
parent f20a044837
commit 7c2ec8f80e
1 changed files with 4 additions and 5 deletions

View File

@ -43,10 +43,9 @@ if(WIN32)
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(WARNING_FLAGS set(WARNING_FLAGS "-Wunused-variable")
-Wunused-variable)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${WARNING_FLAGS}")
endif() endif()
if(MINGW) if(MINGW)