Warn about missing override specifiers, if supported (gcc 5.1, clang 3.5)
This commit is contained in:
parent
83c805e8fb
commit
ff41c8f7cb
|
@ -174,6 +174,18 @@ if( CMAKE_VERSION VERSION_LESS 3.1 AND ( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_C
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# Warn about missing override specifiers, if supported
|
||||||
|
if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-Wsuggest-override" COMPILER_SUPPORTS_WSUGGEST_OVERRIDE)
|
||||||
|
|
||||||
|
if(COMPILER_SUPPORTS_WSUGGEST_OVERRIDE)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
#================================================
|
#================================================
|
||||||
# Set flags for GCC, or treat llvm as GCC
|
# Set flags for GCC, or treat llvm as GCC
|
||||||
#================================================
|
#================================================
|
||||||
|
|
Loading…
Reference in New Issue