Skip to content

Commit

Permalink
building: added -Wsuggest-override to c++ compiler flags
Browse files Browse the repository at this point in the history
- warn about overriding virtual functions that are
  not marked with the override keyword
  • Loading branch information
franku committed Dec 12, 2018
1 parent 703ffae commit 0b48224
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/CMakeLists.txt
Expand Up @@ -33,8 +33,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-Wsuggest-override compiler_will_suggest_override)


if (${compiler_will_suggest_override})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
endif()

if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
include_directories(/usr/include)
Expand Down

0 comments on commit 0b48224

Please sign in to comment.