Compile OpenCV with GCC visibility set to hidden
This commit is contained in:

committed by
Andrey Pavlenko

parent
8130d92602
commit
b8ed00bd64
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
|
||||
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(__ANDROID__)
|
||||
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/objdetect.hpp>
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace cv
|
||||
{
|
||||
class DetectionBasedTracker
|
||||
class CV_EXPORTS DetectionBasedTracker
|
||||
{
|
||||
public:
|
||||
struct Parameters
|
||||
|
@@ -73,8 +73,10 @@
|
||||
# define CV_ENABLE_UNROLLED 1
|
||||
#endif
|
||||
|
||||
#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS
|
||||
#if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
|
||||
# define CV_EXPORTS __declspec(dllexport)
|
||||
#elif defined __GNUC__ && __GNUC__ >= 4
|
||||
# define CV_EXPORTS __attribute__ ((visibility ("default")))
|
||||
#else
|
||||
# define CV_EXPORTS
|
||||
#endif
|
||||
|
@@ -174,7 +174,7 @@ public:
|
||||
To make it all work, you need to specialize Ptr<>::delete_obj(), like:
|
||||
|
||||
\code
|
||||
template<> void Ptr<MyObjectType>::delete_obj() { call_destructor_func(obj); }
|
||||
template<> CV_EXPORTS void Ptr<MyObjectType>::delete_obj() { call_destructor_func(obj); }
|
||||
\endcode
|
||||
|
||||
\note{if MyObjectType is a C++ class with a destructor, you do not need to specialize delete_obj(),
|
||||
|
@@ -272,7 +272,11 @@ CV_INLINE double cvRandReal( CvRNG* rng )
|
||||
#define IPL_BORDER_REFLECT 2
|
||||
#define IPL_BORDER_WRAP 3
|
||||
|
||||
typedef struct CV_EXPORTS _IplImage
|
||||
typedef struct
|
||||
#ifdef __cplusplus
|
||||
CV_EXPORTS
|
||||
#endif
|
||||
_IplImage
|
||||
{
|
||||
int nSize; /* sizeof(IplImage) */
|
||||
int ID; /* version (=0)*/
|
||||
@@ -563,7 +567,11 @@ CV_INLINE int cvIplDepth( int type )
|
||||
#define CV_MAX_DIM 32
|
||||
#define CV_MAX_DIM_HEAP 1024
|
||||
|
||||
typedef struct CV_EXPORTS CvMatND
|
||||
typedef struct
|
||||
#ifdef __cplusplus
|
||||
CV_EXPORTS
|
||||
#endif
|
||||
CvMatND
|
||||
{
|
||||
int type;
|
||||
int dims;
|
||||
@@ -610,7 +618,11 @@ CvMatND;
|
||||
|
||||
struct CvSet;
|
||||
|
||||
typedef struct CV_EXPORTS CvSparseMat
|
||||
typedef struct
|
||||
#ifdef __cplusplus
|
||||
CV_EXPORTS
|
||||
#endif
|
||||
CvSparseMat
|
||||
{
|
||||
int type;
|
||||
int dims;
|
||||
|
@@ -42,9 +42,7 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef HAVE_CVCONFIG_H
|
||||
#include "cvconfig.h"
|
||||
#endif
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/gpu.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
@@ -542,8 +542,8 @@ protected:
|
||||
Ptr<CvVideoWriter> writer;
|
||||
};
|
||||
|
||||
template<> void Ptr<CvCapture>::delete_obj();
|
||||
template<> void Ptr<CvVideoWriter>::delete_obj();
|
||||
template<> CV_EXPORTS void Ptr<CvCapture>::delete_obj();
|
||||
template<> CV_EXPORTS void Ptr<CvVideoWriter>::delete_obj();
|
||||
|
||||
} // cv
|
||||
|
||||
|
@@ -1205,11 +1205,7 @@ static int to_ok(PyTypeObject *to)
|
||||
return (PyType_Ready(to) == 0);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
#if defined WIN32 || defined _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void initcv2();
|
||||
extern "C" CV_EXPORTS void initcv2();
|
||||
|
||||
void initcv2()
|
||||
{
|
||||
|
@@ -1,16 +1,7 @@
|
||||
#ifndef __OPENCV_GTESTCV_HPP__
|
||||
#define __OPENCV_GTESTCV_HPP__
|
||||
|
||||
#ifdef HAVE_CVCONFIG_H
|
||||
# include "cvconfig.h"
|
||||
#endif
|
||||
|
||||
#ifndef GTEST_CREATE_SHARED_LIBRARY
|
||||
#ifdef BUILD_SHARED_LIBS
|
||||
#define GTEST_LINKED_AS_SHARED_LIBRARY 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "opencv2/core/cvdef.h"
|
||||
#include <stdarg.h> // for va_list
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
@@ -1912,19 +1912,7 @@ using ::std::tuple_size;
|
||||
|
||||
#endif // GTEST_HAS_SEH
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
# if GTEST_LINKED_AS_SHARED_LIBRARY
|
||||
# define GTEST_API_ __declspec(dllimport)
|
||||
# elif GTEST_CREATE_SHARED_LIBRARY
|
||||
# define GTEST_API_ __declspec(dllexport)
|
||||
# endif
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
#ifndef GTEST_API_
|
||||
# define GTEST_API_
|
||||
#endif
|
||||
#define GTEST_API_ CV_EXPORTS
|
||||
|
||||
#ifdef __GNUC__
|
||||
// Ask the compiler to never inline a given function.
|
||||
|
@@ -1,16 +1,6 @@
|
||||
#ifndef __OPENCV_TS_PERF_HPP__
|
||||
#define __OPENCV_TS_PERF_HPP__
|
||||
|
||||
#ifdef HAVE_CVCONFIG_H
|
||||
# include "cvconfig.h"
|
||||
#endif
|
||||
|
||||
#ifndef GTEST_CREATE_SHARED_LIBRARY
|
||||
# ifdef BUILD_SHARED_LIBS
|
||||
# define GTEST_LINKED_AS_SHARED_LIBRARY 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "opencv2/core.hpp"
|
||||
#include "ts_gtest.h"
|
||||
|
||||
|
Reference in New Issue
Block a user