Skip to content

CUDA: Fix user-set architectures during detection with Visual Studio

Raul Tambre requested to merge tambre/cmake:cuda_detect_vs_codegen into master

If the user specifies CMAKE_CUDA_ARCHITECTURES we use those during detection and error out if they don't work. For Visual Studio a dummy project file is used instead of invoking the compiler directly. NVCC would thus use its default and we'd fail if CMAKE_CUDA_ARCHITECTURES was anything other than NVCC's default.

Use the necessary project file variable in CMakeDetermineCompilerId.cmake to match other generators.

Fixes: #21492 (closed)
Backport: release

Edited by Brad King

Merge request reports