Merge pull request #12097 from xsacha:master

This commit is contained in:
Alexander Alekhin 2018-08-04 13:14:22 +00:00
commit 183cfd3a2e

View File

@ -3,7 +3,7 @@ if(WIN32 AND NOT MSVC)
return()
endif()
if(NOT APPLE AND CV_CLANG)
if(NOT UNIX AND CV_CLANG)
message(STATUS "CUDA compilation is disabled (due to Clang unsupported on your platform).")
return()
endif()
@ -188,6 +188,13 @@ if(CUDA_FOUND)
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
set(${var}_backup_in_cuda_compile_ "${${var}}")
if (CV_CLANG)
# we remove -Winconsistent-missing-override and -Qunused-arguments
# just in case we are compiling CUDA with gcc but OpenCV with clang
string(REPLACE "-Winconsistent-missing-override" "" ${var} "${${var}}")
string(REPLACE "-Qunused-arguments" "" ${var} "${${var}}")
endif()
# we remove /EHa as it generates warnings under windows
string(REPLACE "/EHa" "" ${var} "${${var}}")