diff options
author | Brad King <brad.king@kitware.com> | 2023-03-10 17:35:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-12 11:52:15 (GMT) |
commit | 7a7793e6d7a230b3c208319dce337c6eec54897a (patch) | |
tree | 4cf534118e8c9bee47c4d031a619844f3f2124bc /Modules/FindCUDA.cmake | |
parent | d6353e74b4dc53b98943d5d66ab5ffb0bef04d08 (diff) | |
download | CMake-7a7793e6d7a230b3c208319dce337c6eec54897a.zip CMake-7a7793e6d7a230b3c208319dce337c6eec54897a.tar.gz CMake-7a7793e6d7a230b3c208319dce337c6eec54897a.tar.bz2 |
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.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index c2ec82e..f65bb73 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() |