From c5bf15e009c79cf1470c3d99a1059220a2938d05 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sat, 30 Jan 2021 11:32:27 +0000 Subject: [PATCH] build: fix cv2.cpp compilation --- modules/core/include/opencv2/core/utils/tls.hpp | 4 +++- modules/python/src2/cv2.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/core/include/opencv2/core/utils/tls.hpp b/modules/core/include/opencv2/core/utils/tls.hpp index b5f1138593..c0d2962cb8 100644 --- a/modules/core/include/opencv2/core/utils/tls.hpp +++ b/modules/core/include/opencv2/core/utils/tls.hpp @@ -5,7 +5,9 @@ #ifndef OPENCV_UTILS_TLS_HPP #define OPENCV_UTILS_TLS_HPP -#include +#ifndef OPENCV_CORE_UTILITY_H +#error "tls.hpp must be included after opencv2/core/utility.hpp or opencv2/core.hpp" +#endif namespace cv { diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index 0a986c1a44..f0dcc38d0f 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -31,13 +31,14 @@ #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include +#include "opencv2/opencv_modules.hpp" +#include "opencv2/core.hpp" #include "opencv2/core/utils/configuration.private.hpp" #include "opencv2/core/utils/logger.hpp" #include "opencv2/core/utils/tls.hpp" #include "pyopencv_generated_include.h" #include "opencv2/core/types_c.h" -#include "opencv2/opencv_modules.hpp" #include "pycompat.hpp" #include