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
parent
f20a044837
commit
7c2ec8f80e
|
@ -43,14 +43,13 @@ if(WIN32)
|
|||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
set(WARNING_FLAGS
|
||||
-Wunused-variable)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
|
||||
set(WARNING_FLAGS "-Wunused-variable")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${WARNING_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in New Issue