Skip to content

Commit

Permalink
CMakeLists.txt - allow compilers without -Wsuggest-override
Browse files Browse the repository at this point in the history
test for the -Wsuggest-override compiler option
  • Loading branch information
winterz committed Feb 20, 2020
1 parent 2908173 commit fb0e905
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ if(MSVC)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_VERSION VERSION_LESS "3.0")
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wsuggest-override HAVE_GXX_SUGGEST_OVERRIDE)
if(HAVE_GXX_SUGGEST_OVERRIDE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
else()
add_compile_options(-Wsuggest-override)
endif()
endif()

Expand Down

0 comments on commit fb0e905

Please sign in to comment.