Commit 00292546 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #14717 from alalek:core_visibility_handling

parents 8fae3617 f5ca9d3f
...@@ -371,10 +371,10 @@ Cv64suf; ...@@ -371,10 +371,10 @@ Cv64suf;
# define OPENCV_DISABLE_DEPRECATED_COMPATIBILITY # define OPENCV_DISABLE_DEPRECATED_COMPATIBILITY
#endif #endif
#ifdef CVAPI_EXPORTS #ifndef CV_EXPORTS
# if (defined _WIN32 || defined WINCE || defined __CYGWIN__) # if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined(CVAPI_EXPORTS)
# define CV_EXPORTS __declspec(dllexport) # define CV_EXPORTS __declspec(dllexport)
# elif defined __GNUC__ && __GNUC__ >= 4 # elif defined __GNUC__ && __GNUC__ >= 4 && (defined(CVAPI_EXPORTS) || defined(__APPLE__))
# define CV_EXPORTS __attribute__ ((visibility ("default"))) # define CV_EXPORTS __attribute__ ((visibility ("default")))
# endif # endif
#endif #endif
......
...@@ -61,7 +61,6 @@ ocv_update(OPENCV_PYTHON_EXTENSION_BUILD_PATH "${LIBRARY_OUTPUT_PATH}/${MODULE_I ...@@ -61,7 +61,6 @@ ocv_update(OPENCV_PYTHON_EXTENSION_BUILD_PATH "${LIBRARY_OUTPUT_PATH}/${MODULE_I
set_target_properties(${the_module} PROPERTIES set_target_properties(${the_module} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${OPENCV_PYTHON_EXTENSION_BUILD_PATH}" LIBRARY_OUTPUT_DIRECTORY "${OPENCV_PYTHON_EXTENSION_BUILD_PATH}"
ARCHIVE_OUTPUT_NAME ${the_module} # prevent name conflict for python2/3 outputs ARCHIVE_OUTPUT_NAME ${the_module} # prevent name conflict for python2/3 outputs
DEFINE_SYMBOL CVAPI_EXPORTS
PREFIX "" PREFIX ""
OUTPUT_NAME cv2 OUTPUT_NAME cv2
SUFFIX ${CVPY_SUFFIX}) SUFFIX ${CVPY_SUFFIX})
......
...@@ -1769,8 +1769,12 @@ static int to_ok(PyTypeObject *to) ...@@ -1769,8 +1769,12 @@ static int to_ok(PyTypeObject *to)
} }
#if defined(__GNUC__)
#pragma GCC visibility push(default)
#endif
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
extern "C" CV_EXPORTS PyObject* PyInit_cv2(); PyMODINIT_FUNC PyInit_cv2();
static struct PyModuleDef cv2_moduledef = static struct PyModuleDef cv2_moduledef =
{ {
PyModuleDef_HEAD_INIT, PyModuleDef_HEAD_INIT,
...@@ -1783,7 +1787,7 @@ static struct PyModuleDef cv2_moduledef = ...@@ -1783,7 +1787,7 @@ static struct PyModuleDef cv2_moduledef =
PyObject* PyInit_cv2() PyObject* PyInit_cv2()
#else #else
extern "C" CV_EXPORTS void initcv2(); PyMODINIT_FUNC initcv2();
void initcv2() void initcv2()
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment