summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index f68c4b2..66020e8 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -260,11 +260,11 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
set(nvcc_test_flags "--keep --keep-dir tmp")
if(CMAKE_CUDA_HOST_COMPILER)
string(APPEND nvcc_test_flags " -ccbin=\"${CMAKE_CUDA_HOST_COMPILER}\"")
-
- # If the user has specified a host compiler we should fail instead of trying without.
- # Succeeding detection without may result in confusing errors later on, see #21076.
- set(CMAKE_CUDA_COMPILER_ID_REQUIRE_SUCCESS ON)
endif()
+ # If we have extracted the vendor as NVIDIA we should require detection to
+ # work. If we don't, users will get confusing errors later about failure
+ # to detect a default value for CMAKE_CUDA_ARCHITECTURES
+ set(CMAKE_CUDA_COMPILER_ID_REQUIRE_SUCCESS ON)
elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
set(clang_test_flags "--cuda-path=\"${CMAKE_CUDA_COMPILER_LIBRARY_ROOT}\"")
if(CMAKE_CROSSCOMPILING)