Merge pull request #19985 from fpetrogalli:disable_threads

* [build][option] Introduce `OPENCV_DISABLE_THREAD_SUPPORT` option.

The option forces the library to build without thread support.

* update handling of OPENCV_DISABLE_THREAD_SUPPORT

- reduce amount of #if conditions

* [to squash] cmake: apply mode vars in toolchains too

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
This commit is contained in:
Francesco Petrogalli
2021-07-08 21:21:21 +01:00
committed by GitHub
parent 59ae0e0013
commit b928ebdd53
16 changed files with 435 additions and 16 deletions
+3 -2
View File
@@ -7,7 +7,7 @@
#include <opencv2/core/bindings_utils.hpp>
#ifdef CV_CXX11
#if defined(CV_CXX11) && !defined(OPENCV_DISABLE_THREAD_SUPPORT)
#include <thread>
#include <chrono>
#endif
@@ -85,7 +85,8 @@ TEST(Core_Async, LikePythonTest)
}
#ifdef CV_CXX11
#if defined(CV_CXX11) && !defined(OPENCV_DISABLE_THREAD_SUPPORT)
TEST(Core_Async, AsyncThread_Simple)
{
Mat m(3, 3, CV_32FC1, Scalar::all(5.0f));