diff options
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index cd1407d..5552fa9 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -747,11 +747,10 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator(); - int commandLineLengthLimit = -1; - if (!this->ForceResponseFile()) { - commandLineLengthLimit = calculateCommandLineLengthLimit( - globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule())); - } + // Device linking currently doesn't support response files so + // do not check if the user has explicitly forced a response file. + int const commandLineLengthLimit = calculateCommandLineLengthLimit( + globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule())); const std::string rspfile = std::string(cmake::GetCMakeFilesDirectoryPostSlash()) + @@ -1033,8 +1032,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator(); + bool const lang_supports_response = + !(this->TargetLinkLanguage == "RC" || this->TargetLinkLanguage == "CUDA"); int commandLineLengthLimit = -1; - if (!this->ForceResponseFile()) { + if (!lang_supports_response || !this->ForceResponseFile()) { commandLineLengthLimit = calculateCommandLineLengthLimit( globalGen.GetRuleCmdLength(this->LanguageLinkerRule())); } |