diff options
author | Brad King <brad.king@kitware.com> | 2022-02-18 17:39:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-18 17:54:12 (GMT) |
commit | f75299b80380c13ff29c934c3a5ad35ba5e3da1c (patch) | |
tree | e1f1d83bcf063aae98ac43e68566016728bba820 | |
parent | a1cb4485805337d4fc995621187d392047dad789 (diff) | |
download | CMake-f75299b80380c13ff29c934c3a5ad35ba5e3da1c.zip CMake-f75299b80380c13ff29c934c3a5ad35ba5e3da1c.tar.gz CMake-f75299b80380c13ff29c934c3a5ad35ba5e3da1c.tar.bz2 |
CUDA: Restore support for non-"all" CUDA_ARCHITECTURES with nvcc 11.5+
Since commit 8f64df0a7c (CUDA: Generic all and all-major support,
2021-12-19, v3.23.0-rc1~23^2), setting `CUDA_ARCHITECTURES` to a value
other than `all` or `all-major` is ignored with NVCC 11.5+. Fix the
logic to return early only when actually using an "all" value.
Fixes: #23243
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9f1029e..afcac5c 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3452,12 +3452,10 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(std::string& flags) const cmSystemTools::OP_GREATER_EQUAL, this->Makefile->GetDefinition("CMAKE_CUDA_COMPILER_VERSION"), "11.5")) { - if (property == "all") { - flags += " -arch=all"; - } else if (property == "all-major") { - flags += " -arch=all-major"; + if (property == "all" || property == "all-major") { + flags = cmStrCat(flags, " -arch=", property); + return; } - return; } if (property == "all") { |