Skip to content

Commit 4ae30ec

Browse files
committed
Merge pull request opencv#9838 from alalek:fix_ocl_world_build
2 parents e356ca2 + 88225eb commit 4ae30ec

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

modules/core/include/opencv2/core/opencl/runtime/opencl_clamdblas.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@
4444

4545
#ifdef HAVE_CLAMDBLAS
4646

47-
#ifndef CL_RUNTIME_EXPORT
48-
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined _WIN32 || defined WINCE)
49-
#define CL_RUNTIME_EXPORT __declspec(dllimport)
50-
#else
51-
#define CL_RUNTIME_EXPORT
52-
#endif
53-
#endif
47+
#include "opencl_core.hpp"
5448

5549
#include "autogenerated/opencl_clamdblas.hpp"
5650

modules/core/include/opencv2/core/opencl/runtime/opencl_clamdfft.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@
4444

4545
#ifdef HAVE_CLAMDFFT
4646

47-
#ifndef CL_RUNTIME_EXPORT
48-
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined _WIN32 || defined WINCE)
49-
#define CL_RUNTIME_EXPORT __declspec(dllimport)
50-
#else
51-
#define CL_RUNTIME_EXPORT
52-
#endif
53-
#endif
47+
#include "opencl_core.hpp"
5448

5549
#include "autogenerated/opencl_clamdfft.hpp"
5650

modules/core/include/opencv2/core/opencl/runtime/opencl_core.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
#ifdef HAVE_OPENCL
4646

4747
#ifndef CL_RUNTIME_EXPORT
48-
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined _WIN32 || defined WINCE)
48+
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined _WIN32 || defined WINCE) && \
49+
!(defined(__OPENCV_BUILD) && defined(OPENCV_MODULE_IS_PART_OF_WORLD))
4950
#define CL_RUNTIME_EXPORT __declspec(dllimport)
5051
#else
5152
#define CL_RUNTIME_EXPORT

modules/world/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ ocv_module_include_directories()
5959
#message(STATUS "${OPENCV_MODULE_${the_module}_SOURCES}")
6060
ocv_create_module(${link_deps})
6161

62+
ocv_target_compile_definitions(${the_module} PRIVATE OPENCV_MODULE_IS_PART_OF_WORLD=1)
63+
6264
if(BUILD_opencv_imgcodecs AND OPENCV_MODULE_opencv_imgcodecs_IS_PART_OF_WORLD)
6365
ocv_imgcodecs_configure_target()
6466
endif()

0 commit comments

Comments
 (0)