mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Merge pull request #1101 from jet47:cudev-stub-lib
This commit is contained in:
commit
3b8a13a1ed
@ -8,28 +8,14 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4189 /wd4505 -Wundef -Wmissing-declarati
|
||||
|
||||
ocv_add_module(cudev)
|
||||
|
||||
ocv_module_include_directories(opencv_core)
|
||||
|
||||
file(GLOB_RECURSE lib_hdrs "include/opencv2/*.hpp")
|
||||
file(GLOB lib_srcs "src/*.cpp")
|
||||
|
||||
add_custom_target(${the_module} SOURCES ${lib_hdrs})
|
||||
ocv_set_module_sources(HEADERS ${lib_hdrs} SOURCES ${lib_srcs})
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${the_module} PROPERTIES FOLDER "modules")
|
||||
endif()
|
||||
|
||||
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
|
||||
# we remove /EHa as it generates warnings under windows
|
||||
string(REPLACE "/EHa" "" ${var} "${${var}}")
|
||||
|
||||
# we remove -ggdb3 flag as it leads to preprocessor errors when compiling CUDA files (CUDA 4.1)
|
||||
string(REPLACE "-ggdb3" "" ${var} "${${var}}")
|
||||
|
||||
# we remove -Wsign-promo as it generates warnings under linux
|
||||
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
|
||||
|
||||
# we remove -fvisibility-inlines-hidden because it's used for C++ compiler
|
||||
# but NVCC uses C compiler by default
|
||||
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
|
||||
endforeach()
|
||||
ocv_create_module()
|
||||
|
||||
if(BUILD_TESTS)
|
||||
add_subdirectory(test)
|
||||
|
11
modules/cudev/src/stub.cpp
Normal file
11
modules/cudev/src/stub.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include <opencv2/core/cvdef.h>
|
||||
|
||||
namespace cv { namespace cudev {
|
||||
|
||||
CV_EXPORTS void stubFunc();
|
||||
|
||||
}}
|
||||
|
||||
void cv::cudev::stubFunc()
|
||||
{
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
set(test_deps opencv_core opencv_imgproc opencv_highgui opencv_ts ${OPENCV_MODULE_opencv_ts_DEPS})
|
||||
set(test_deps opencv_cudev opencv_core opencv_imgproc opencv_highgui opencv_ts ${OPENCV_MODULE_opencv_ts_DEPS})
|
||||
|
||||
ocv_check_dependencies(${test_deps})
|
||||
|
||||
@ -13,6 +13,21 @@ if(OCV_DEPENDENCIES_FOUND)
|
||||
source_group("Include" FILES ${test_hdrs})
|
||||
set(OPENCV_TEST_${the_module}_SOURCES ${test_srcs} ${test_hdrs})
|
||||
|
||||
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
|
||||
# we remove /EHa as it generates warnings under windows
|
||||
string(REPLACE "/EHa" "" ${var} "${${var}}")
|
||||
|
||||
# we remove -ggdb3 flag as it leads to preprocessor errors when compiling CUDA files (CUDA 4.1)
|
||||
string(REPLACE "-ggdb3" "" ${var} "${${var}}")
|
||||
|
||||
# we remove -Wsign-promo as it generates warnings under linux
|
||||
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
|
||||
|
||||
# we remove -fvisibility-inlines-hidden because it's used for C++ compiler
|
||||
# but NVCC uses C compiler by default
|
||||
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
|
||||
endforeach()
|
||||
|
||||
CUDA_ADD_EXECUTABLE(${the_target} ${OPENCV_TEST_${the_module}_SOURCES})
|
||||
target_link_libraries(${the_target} ${test_deps} ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES})
|
||||
add_dependencies(opencv_tests ${the_target})
|
||||
|
Loading…
Reference in New Issue
Block a user