mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
CUDA: Improve error message for nonexistent compiler paths
Fixes: #25709
This commit is contained in:

committed by
Brad King

parent
b557cd0f49
commit
bf442068bb
@@ -306,7 +306,7 @@ endif()
|
|||||||
# If the user did not set CMAKE_CUDA_ARCHITECTURES, use the compiler's default.
|
# If the user did not set CMAKE_CUDA_ARCHITECTURES, use the compiler's default.
|
||||||
if("${CMAKE_CUDA_ARCHITECTURES}" STREQUAL "")
|
if("${CMAKE_CUDA_ARCHITECTURES}" STREQUAL "")
|
||||||
cmake_policy(GET CMP0104 _CUDA_CMP0104)
|
cmake_policy(GET CMP0104 _CUDA_CMP0104)
|
||||||
if(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" OR _CUDA_CMP0104 STREQUAL "NEW")
|
if(CMAKE_CUDA_COMPILER_ID AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" OR _CUDA_CMP0104 STREQUAL "NEW"))
|
||||||
set(CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES_DEFAULT}" CACHE STRING "CUDA architectures")
|
set(CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES_DEFAULT}" CACHE STRING "CUDA architectures")
|
||||||
if(NOT CMAKE_CUDA_ARCHITECTURES)
|
if(NOT CMAKE_CUDA_ARCHITECTURES)
|
||||||
message(FATAL_ERROR "Failed to detect a default CUDA architecture.\n\nCompiler output:\n${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}")
|
message(FATAL_ERROR "Failed to detect a default CUDA architecture.\n\nCompiler output:\n${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}")
|
||||||
|
Reference in New Issue
Block a user