diff --git a/3rdparty/tbb/CMakeLists.txt b/3rdparty/tbb/CMakeLists.txt index a127473eea..dadc785439 100644 --- a/3rdparty/tbb/CMakeLists.txt +++ b/3rdparty/tbb/CMakeLists.txt @@ -72,7 +72,7 @@ if(NOT EXISTS "${tbb_tarball}") file(REMOVE "${tbb_tarball}") message(FATAL_ERROR "Downloaded TBB source tarball has invalid MD5 hash: ${tbb_local_md5} (expected: ${tbb_md5})") endif() - + if(EXISTS "${tbb_src_dir}") file(REMOVE_RECURSE "${tbb_src_dir}") endif() @@ -119,18 +119,21 @@ endif() add_library(tbb STATIC ${lib_srcs} ${lib_hdrs} "${CMAKE_CURRENT_SOURCE_DIR}/android_additional.h" "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_version_file}") target_link_libraries(tbb c m dl) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -include \"${CMAKE_CURRENT_SOURCE_DIR}/android_additional.h\"") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include \"${CMAKE_CURRENT_SOURCE_DIR}/android_additional.h\"") + +ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations) +string(REPLACE "-Werror=non-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set_target_properties(tbb - PROPERTIES OUTPUT_NAME tbb - DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}" - ) - + PROPERTIES OUTPUT_NAME tbb + DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}" + ) + if(ENABLE_SOLUTION_FOLDERS) set_target_properties(tbb PROPERTIES FOLDER "3rdparty") endif() - + if(NOT BUILD_SHARED_LIBS) install(TARGETS tbb ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main) endif() diff --git a/3rdparty/tbb/version_string.tmp b/3rdparty/tbb/version_string.tmp index 257bfa1cbd..81e5e22b6d 100644 --- a/3rdparty/tbb/version_string.tmp +++ b/3rdparty/tbb/version_string.tmp @@ -6,4 +6,4 @@ "TBB: BUILD_GLIBC Unknown" ENDL \ "TBB: BUILD_LD Unknown" ENDL \ "TBB: BUILD_TARGET Unknown" ENDL \ -"TBB: BUILD_COMMAND use cv::getBuildInformation() for details" ENDL \ +"TBB: BUILD_COMMAND use cv::getBuildInformation() for details" ENDL diff --git a/3rdparty/tbb/version_string.ver b/3rdparty/tbb/version_string.ver index 90e1686ef0..87048496fe 100644 --- a/3rdparty/tbb/version_string.ver +++ b/3rdparty/tbb/version_string.ver @@ -6,4 +6,4 @@ #N": BUILD_GLIBC Unknown" ENDL \ #N": BUILD_LD Unknown" ENDL \ #N": BUILD_TARGET Unknown" ENDL \ -#N": BUILD_COMMAND use cv::getBuildInformation() for details" ENDL \ +#N": BUILD_COMMAND use cv::getBuildInformation() for details" ENDL diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index 905ef6c951..d952110636 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -75,6 +75,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) #add_extra_compiler_option(-Wcast-align) #add_extra_compiler_option(-Wstrict-aliasing=2) #add_extra_compiler_option(-Wshadow) + add_extra_compiler_option(-Wno-unnamed-type-template-args) # The -Wno-long-long is required in 64bit systems when including sytem headers. if(X86_64) diff --git a/cmake/OpenCVDetectTBB.cmake b/cmake/OpenCVDetectTBB.cmake index 51ec34ebde..5fc0efbfd5 100644 --- a/cmake/OpenCVDetectTBB.cmake +++ b/cmake/OpenCVDetectTBB.cmake @@ -1,6 +1,6 @@ if(ANDROID) add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/tbb") - ocv_include_directories(${TBB_INCLUDE_DIRS}) + include_directories(SYSTEM ${TBB_INCLUDE_DIRS}) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} tbb) add_definitions(-DTBB_USE_GCC_BUILTINS=1 -D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1 -D__TBB_USE_GENERIC_DWORD_LOAD_STORE=1) set(HAVE_TBB 1) @@ -10,7 +10,7 @@ elseif(UNIX AND NOT APPLE) if(TBB_FOUND) set(HAVE_TBB 1) if(NOT ${TBB_INCLUDE_DIRS} STREQUAL "") - ocv_include_directories(${TBB_INCLUDE_DIRS}) + include_directories(SYSTEM ${TBB_INCLUDE_DIRS}) endif() link_directories(${TBB_LIBRARY_DIRS}) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${TBB_LIBRARIES}) @@ -63,7 +63,7 @@ if(NOT HAVE_TBB) set(HAVE_TBB 1) if(NOT "${TBB_INCLUDE_DIRS}" STREQUAL "") - ocv_include_directories("${TBB_INCLUDE_DIRS}") + include_directories(SYSTEM "${TBB_INCLUDE_DIRS}") endif() endif(TBB_INCLUDE_DIRS) endif(NOT HAVE_TBB)