mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
cuda: prevent CMAKE_CUDA_ARCHITECTURES default from overiding OpenCV architecture search
This commit is contained in:
parent
c9b57819b1
commit
012d853474
@ -726,7 +726,13 @@ if(ENABLE_CUDA_FIRST_CLASS_LANGUAGE)
|
||||
|
||||
cmake_policy(SET CMP0092 NEW) # CMake 3.15+: leave warning flags out of default CMAKE_<LANG>_FLAGS flags.
|
||||
if(CMAKE_CUDA_COMPILER)
|
||||
if(CMAKE_CUDA_ARCHITECTURES)
|
||||
set(USER_DEFINED_CMAKE_CUDA_ARCHITECTURES TRUE)
|
||||
endif()
|
||||
enable_language(CUDA)
|
||||
if(NOT USER_DEFINED_CMAKE_CUDA_ARCHITECTURES)
|
||||
set(CMAKE_CUDA_ARCHITECTURES "")
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
message(WARNING "CUDA: Not detected! If you are not using the default host compiler (g++) then you need to specify both CMAKE_CUDA_HOST_COMPILER and CMAKE_CUDA_COMPILER. e.g. -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/clang++ -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc.")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user