1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

[build][option] Build option to disable filesystem support.

This commit is contained in:
Francesco Petrogalli
2021-04-29 16:32:51 +00:00
parent df05bc65c5
commit 7a31a6edee
7 changed files with 88 additions and 3 deletions
+7
View File
@@ -53,6 +53,8 @@
#include <opencv2/core/utils/tls.hpp>
#include <opencv2/core/utils/instrumentation.hpp>
#include <opencv2/core/utils/filesystem.private.hpp>
namespace cv {
static void _initSystem()
@@ -947,6 +949,7 @@ String format( const char* fmt, ... )
String tempfile( const char* suffix )
{
#if OPENCV_HAVE_FILESYSTEM_SUPPORT
String fname;
#ifndef NO_GETENV
const char *temp_dir = getenv("OPENCV_TEMP_PATH");
@@ -1033,6 +1036,10 @@ String tempfile( const char* suffix )
return fname + suffix;
}
return fname;
#else // OPENCV_HAVE_FILESYSTEM_SUPPORT
CV_UNUSED(suffix);
CV_Error(Error::StsNotImplemented, "File system support is disabled in this OpenCV build!");
#endif // OPENCV_HAVE_FILESYSTEM_SUPPORT
}
static ErrorCallback customErrorCallback = 0;