summaryrefslogtreecommitdiff
path: root/Modules/FindCUDA.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-10 12:35:45 -0500
committerBrad King <brad.king@kitware.com>2023-03-12 07:52:15 -0400
commit7a7793e6d7a230b3c208319dce337c6eec54897a (patch)
tree4cf534118e8c9bee47c4d031a619844f3f2124bc /Modules/FindCUDA.cmake
parentd6353e74b4dc53b98943d5d66ab5ffb0bef04d08 (diff)
downloadcmake-7a7793e6d7a230b3c208319dce337c6eec54897a.tar.gz
FindCUDA: Disallow with CMP0147 under Visual Studio
FindCUDA's custom commands invoke `nvcc`, which invokes `cl`. Under VS this is done without a `/FS` flag, so `.pdb` generation races if we use `BuildInParallel`. The FindCUDA module has already been removed by policy CMP0146 after being deprecated since CMake 3.10, so it is simplest to just disallow this combination of features. Issue: #24576
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r--Modules/FindCUDA.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index c2ec82eb5a..f65bb7321e 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -565,6 +565,13 @@ if(_FindCUDA_CMP0146 STREQUAL "NEW")
message(FATAL_ERROR "The FindCUDA module has been removed by policy CMP0146.")
endif()
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ cmake_policy(GET CMP0147 _FindCUDA_CMP0147)
+ if(_FindCUDA_CMP0147 STREQUAL "NEW")
+ message(FATAL_ERROR "The FindCUDA module does not work in Visual Studio with policy CMP0147.")
+ endif()
+endif()
+
if(_FindCUDA_testing)
set(_FindCUDA_included TRUE)
return()