diff options
author | Brad King <brad.king@kitware.com> | 2021-02-24 14:47:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-02-24 14:47:39 (GMT) |
commit | a70f8770f2d8a9688ea76b05782de6fd6f807cfb (patch) | |
tree | 1fe9d76b7f095058615392fe2d05e37096dfb2a6 | |
parent | e95f7aa0ed4a13e6d36b97fe5a4a3ead1faa13ab (diff) | |
parent | a0fc64ac24baf270bd80b66ec037ea838e9d32bb (diff) | |
download | CMake-a70f8770f2d8a9688ea76b05782de6fd6f807cfb.zip CMake-a70f8770f2d8a9688ea76b05782de6fd6f807cfb.tar.gz CMake-a70f8770f2d8a9688ea76b05782de6fd6f807cfb.tar.bz2 |
Merge topic 'better_cuda_compiler_detection_error_messages' into release-3.20
a0fc64ac24 CUDA: Improve error messages when CUDA compiler detection fails
Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5844
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index dd539b7..1ba537a 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -69,6 +69,10 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_Clang "(clang version)") CMAKE_DETERMINE_COMPILER_ID_VENDOR(CUDA "--version") + if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" AND WIN32) + message(FATAL_ERROR "Clang with CUDA is not yet supported on Windows. See CMake issue #20776.") + endif() + # Find the CUDA toolkit. We store the CMAKE_CUDA_COMPILER_TOOLKIT_ROOT and CMAKE_CUDA_COMPILER_LIBRARY_ROOT # in CMakeCUDACompiler.cmake, so FindCUDAToolkit can avoid searching on future runs and the toolkit stays the same. # This is very similar to FindCUDAToolkit, but somewhat simplified since we can issue fatal errors @@ -167,7 +171,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) unset(search_paths) if(NOT _CUDA_NVCC_EXECUTABLE) - message(FATAL_ERROR "Could not find nvcc, please set CUDAToolkit_ROOT.") + message(FATAL_ERROR "Failed to find nvcc.\nCompiler ${CMAKE_CUDA_COMPILER_ID} requires the CUDA toolkit. Please set the CUDAToolkit_ROOT variable.") endif() endif() endif() @@ -225,10 +229,6 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) set(CMAKE_CUDA_COMPILER_ID_REQUIRE_SUCCESS ON) endif() elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang") - if(WIN32) - message(FATAL_ERROR "Clang with CUDA is not yet supported on Windows. See CMake issue #20776.") - endif() - set(clang_test_flags "--cuda-path=\"${CMAKE_CUDA_COMPILER_LIBRARY_ROOT}\"") if(CMAKE_CROSSCOMPILING) # Need to pass the host target and include directories if we're crosscompiling. |