Disable -Wsuggest-override for scripting files, but not other files
This allows the warning to be active for code which would benefit from it, but not spew hundreds of warnings for code over which KiCad does not have control of the override specifiers.
This commit is contained in:
parent
4505896634
commit
6504b7b55c
|
@ -180,9 +180,7 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
|||
|
||||
CHECK_CXX_COMPILER_FLAG("-Wsuggest-override" COMPILER_SUPPORTS_WSUGGEST_OVERRIDE)
|
||||
|
||||
# Swig generated files do not use override specifier and create a lot of warnings
|
||||
# So do not use -Wsuggest-override with KICAD_SCRIPTING ON, untill a best way is found
|
||||
if(COMPILER_SUPPORTS_WSUGGEST_OVERRIDE AND NOT KICAD_SCRIPTING)
|
||||
if(COMPILER_SUPPORTS_WSUGGEST_OVERRIDE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -327,6 +327,16 @@ if( KICAD_SCRIPTING )
|
|||
pcbnew_wrap.cxx
|
||||
${PCBNEW_SCRIPTING_PYTHON_HELPERS}
|
||||
)
|
||||
|
||||
|
||||
# Swig generated files do not use the override specifier, therefore
|
||||
# disable suggest-override warnings
|
||||
if (COMPILER_SUPPORTS_WSUGGEST_OVERRIDE)
|
||||
set_source_files_properties(pcbnew_wrap.cxx
|
||||
PROPERTIES COMPILE_FLAGS -Wno-suggest-override
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue