diff options
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 9045a4d..0b27dfb 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -171,14 +171,15 @@ void cmVisualStudioGeneratorOptions::FixCudaCodeGeneration() code.clear(); } - if (arch.empty() && gencode.empty()) { - return; - } - // Create a CodeGeneration field with [arch],[code] syntax in each entry. // CUDA will convert it to `-gencode=arch=[arch],code="[code],[arch]"`. FlagValue& result = this->FlagMap["CodeGeneration"]; + // If there are no flags, leave the CodeGeneration field empty. + if (arch.empty() && gencode.empty()) { + return; + } + // First entries for the -arch=<arch> [-code=<code>,...] pair. if (!arch.empty()) { std::string arch_name = arch[0]; |