mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
CUDA: Generate better error message when detecting nvcc
Issue: #23322, #23323
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user