Enable GNU STL debug mode for debug builds

This commit is contained in:
Maksim Shabunin
2017-01-31 12:36:26 +03:00
parent 0aab7c6fc3
commit 50d350bcd1
2 changed files with 5 additions and 1 deletions

View File

@@ -858,10 +858,13 @@ macro(_ocv_create_module)
if((NOT DEFINED OPENCV_MODULE_TYPE AND BUILD_SHARED_LIBS)
OR (DEFINED OPENCV_MODULE_TYPE AND OPENCV_MODULE_TYPE STREQUAL SHARED))
set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS CVAPI_EXPORTS)
set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS)
endif()
if (ENABLE_GNU_STL_DEBUG)
target_compile_definitions(${the_module} PUBLIC _GLIBCXX_DEBUG)
endif()
if(MSVC)
if(CMAKE_CROSSCOMPILING)
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:secchk")