MDEV-34408: Facilitate the addition of warnings into the build system

Create a MY_WARNING_FLAGS_NON_FATAL for testing warnings

Add -Weffc++ as no-error espect, disabling from rocksdb due
to excessive errors that will be corrected later.
This commit is contained in:
Daniel Black 2024-06-14 13:13:40 +10:00 committed by Brandon Nesterenko
parent 78d7bb1d27
commit 971a0ba23c
2 changed files with 11 additions and 0 deletions

View file

@ -41,10 +41,20 @@ SET(MY_WARNING_FLAGS
-Wwrite-strings
)
# Warning flags that are in testing before moving
# to MY_WARNING_FLAGS if stable.
SET(MY_WARNING_FLAGS_NON_FATAL
effc++
)
FOREACH(F ${MY_WARNING_FLAGS})
MY_CHECK_AND_SET_COMPILER_FLAG(${F} DEBUG RELWITHDEBINFO)
ENDFOREACH()
FOREACH(F ${MY_WARNING_FLAGS_NON_FATAL})
MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-error=${F} DEBUG RELWITHDEBINFO)
ENDFOREACH()
SET(MY_ERROR_FLAGS -Werror -fno-operator-names)
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")

View file

@ -10,6 +10,7 @@ SET(CPACK_RPM_rocksdb-engine_PACKAGE_DESCRIPTION "The RocksDB storage engine is
at maximising storage efficiency while maintaining InnoDB-like performance." PARENT_SCOPE)
MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-range-loop-construct)
MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-effc++ DEBUG RELWITHDEBINFO)
MACRO(SKIP_ROCKSDB_PLUGIN msg)
MESSAGE_ONCE(SKIP_ROCKSDB_PLUGIN "Can't build rocksdb engine - ${msg}")