diff --git a/3rdparty/openexr/CMakeLists.txt b/3rdparty/openexr/CMakeLists.txt index 88f60b23c0..1fbfa4f857 100644 --- a/3rdparty/openexr/CMakeLists.txt +++ b/3rdparty/openexr/CMakeLists.txt @@ -110,6 +110,10 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -W -Wreorder -Wunused-result ) +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wclass-memaccess) endif() diff --git a/3rdparty/protobuf/CMakeLists.txt b/3rdparty/protobuf/CMakeLists.txt index f249d2dcc3..f8372dc1ad 100644 --- a/3rdparty/protobuf/CMakeLists.txt +++ b/3rdparty/protobuf/CMakeLists.txt @@ -25,6 +25,10 @@ else() -Warray-bounds # GCC 9+ ) endif() +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() if(CV_ICC) ocv_warnings_disable(CMAKE_CXX_FLAGS -wd265 -wd858 -wd873 -wd2196 diff --git a/modules/calib3d/CMakeLists.txt b/modules/calib3d/CMakeLists.txt index a38fdf18d8..1c31ad1903 100644 --- a/modules/calib3d/CMakeLists.txt +++ b/modules/calib3d/CMakeLists.txt @@ -3,6 +3,10 @@ set(debug_modules "") if(DEBUG_opencv_calib3d) list(APPEND debug_modules opencv_highgui) endif() +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() ocv_define_module(calib3d opencv_imgproc opencv_features2d ${debug_modules} WRAP java python js ) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index beba9f804e..568a8afef1 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -38,6 +38,10 @@ endif() if(HAVE_CUDA) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wenum-compare -Wunused-function -Wshadow) endif() +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() if(CV_TRACE AND HAVE_ITT) add_definitions(-DOPENCV_WITH_ITT=1) diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt index 4019356392..680be360ba 100644 --- a/modules/dnn/CMakeLists.txt +++ b/modules/dnn/CMakeLists.txt @@ -35,6 +35,10 @@ else() -Wunused-parameter -Wsign-compare ) endif() +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() if(HAVE_CUDA) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef) endif() diff --git a/modules/features2d/CMakeLists.txt b/modules/features2d/CMakeLists.txt index 1d29320a14..28af58565b 100644 --- a/modules/features2d/CMakeLists.txt +++ b/modules/features2d/CMakeLists.txt @@ -1,6 +1,10 @@ set(the_description "2D Features Framework") ocv_add_dispatched_file(sift SSE4_1 AVX2 AVX512_SKX) +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() set(debug_modules "") if(DEBUG_opencv_features2d) diff --git a/modules/flann/CMakeLists.txt b/modules/flann/CMakeLists.txt index 78e041129b..5935f679d4 100644 --- a/modules/flann/CMakeLists.txt +++ b/modules/flann/CMakeLists.txt @@ -1,2 +1,6 @@ set(the_description "Clustering and Search in Multi-Dimensional Spaces") +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() ocv_define_module(flann opencv_core WRAP python) diff --git a/modules/imgproc/CMakeLists.txt b/modules/imgproc/CMakeLists.txt index 3b45482481..5787ec502c 100644 --- a/modules/imgproc/CMakeLists.txt +++ b/modules/imgproc/CMakeLists.txt @@ -12,6 +12,10 @@ ocv_add_dispatched_file(smooth SSE2 SSE4_1 AVX2) ocv_add_dispatched_file(sumpixels SSE2 AVX2 AVX512_SKX) ocv_add_dispatched_file(undistort SSE2 AVX2) ocv_define_module(imgproc opencv_core WRAP java python js) +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() ocv_check_environment_variables(OPENCV_IPP_GAUSSIAN_BLUR) option(OPENCV_IPP_GAUSSIAN_BLUR "Enable IPP optimizations for GaussianBlur (+8Mb in binary size)" OFF) diff --git a/modules/ml/CMakeLists.txt b/modules/ml/CMakeLists.txt index 1b64cc4f17..8b76e0c8ad 100644 --- a/modules/ml/CMakeLists.txt +++ b/modules/ml/CMakeLists.txt @@ -1,2 +1,6 @@ set(the_description "Machine Learning") +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() ocv_define_module(ml opencv_core WRAP java python) diff --git a/modules/objdetect/CMakeLists.txt b/modules/objdetect/CMakeLists.txt index 414e578099..34b77eab6b 100644 --- a/modules/objdetect/CMakeLists.txt +++ b/modules/objdetect/CMakeLists.txt @@ -1,4 +1,8 @@ set(the_description "Object Detection") +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() ocv_define_module(objdetect opencv_core opencv_imgproc opencv_calib3d WRAP java python js) if(HAVE_QUIRC) diff --git a/modules/shape/CMakeLists.txt b/modules/shape/CMakeLists.txt index 527a0c2f71..209eb11f34 100644 --- a/modules/shape/CMakeLists.txt +++ b/modules/shape/CMakeLists.txt @@ -1,2 +1,6 @@ set(the_description "Shape descriptors and matchers") +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() ocv_define_module(shape opencv_core opencv_imgproc opencv_video WRAP python) diff --git a/modules/stitching/CMakeLists.txt b/modules/stitching/CMakeLists.txt index 44f35eb59b..7ea34a1608 100644 --- a/modules/stitching/CMakeLists.txt +++ b/modules/stitching/CMakeLists.txt @@ -3,6 +3,10 @@ set(the_description "Images stitching") if(HAVE_CUDA) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wstrict-aliasing) endif() +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() set(STITCHING_CONTRIB_DEPS "opencv_xfeatures2d") if(BUILD_SHARED_LIBS AND BUILD_opencv_world AND OPENCV_WORLD_EXCLUDE_EXTRA_MODULES) diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt index f95bed0793..fd6e008333 100644 --- a/modules/ts/CMakeLists.txt +++ b/modules/ts/CMakeLists.txt @@ -15,6 +15,10 @@ if(WINRT) endif() ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef) +if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) +endif() ocv_add_module(ts INTERNAL opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui) diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index 6ae9586fd4..8cb11c0222 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -41,6 +41,10 @@ foreach(sample_filename ${cpp_samples}) ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override -Wsuggest-override) endif() endif() + if(ARM AND CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + # suppress warnings from GCC only on 7.1 and later + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-psabi) + endif() set(package "cpp") if(sample_filename MATCHES "tutorial_code") set(package "tutorial")