diff options
-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") { |