mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #16684 from pwuertz:ignore_clang_mat_inl
* Ignore clang warnings for deprecated enum+enum operations in mat.inl.hpp * build: added customization macros, cmake flags for OpenCV build
This commit is contained in:
parent
f00607c8ac
commit
5012fc5d23
@ -151,6 +151,10 @@ if(CV_GCC OR CV_CLANG)
|
|||||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||||
add_extra_compiler_option(-Wno-missing-field-initializers) # GCC 4.x emits warnings about {}, fixed in GCC 5+
|
add_extra_compiler_option(-Wno-missing-field-initializers) # GCC 4.x emits warnings about {}, fixed in GCC 5+
|
||||||
endif()
|
endif()
|
||||||
|
if(CV_CLANG AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
|
||||||
|
add_extra_compiler_option(-Wno-deprecated-enum-enum-conversion)
|
||||||
|
add_extra_compiler_option(-Wno-deprecated-anon-enum-enum-conversion)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
add_extra_compiler_option(-fdiagnostics-show-option)
|
add_extra_compiler_option(-fdiagnostics-show-option)
|
||||||
|
|
||||||
|
@ -54,6 +54,21 @@
|
|||||||
#pragma warning( disable: 4127 )
|
#pragma warning( disable: 4127 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CV_SKIP_DISABLE_CLANG_ENUM_WARNINGS)
|
||||||
|
// nothing
|
||||||
|
#elif defined(CV_FORCE_DISABLE_CLANG_ENUM_WARNINGS)
|
||||||
|
#define CV_DISABLE_CLANG_ENUM_WARNINGS
|
||||||
|
#elif defined(__clang__) && defined(__has_warning)
|
||||||
|
#if __has_warning("-Wdeprecated-enum-enum-conversion") && __has_warning("-Wdeprecated-anon-enum-enum-conversion")
|
||||||
|
#define CV_DISABLE_CLANG_ENUM_WARNINGS
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-anon-enum-enum-conversion"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace cv
|
namespace cv
|
||||||
{
|
{
|
||||||
CV__DEBUG_NS_BEGIN
|
CV__DEBUG_NS_BEGIN
|
||||||
@ -4034,4 +4049,9 @@ inline void UMatData::markDeviceCopyObsolete(bool flag)
|
|||||||
#pragma warning( pop )
|
#pragma warning( pop )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS
|
||||||
|
#undef CV_DISABLE_CLANG_ENUM_WARNINGS
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user