diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 8 |
4 files changed, 20 insertions, 16 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index cc2536c..ced0c26 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -750,6 +750,10 @@ bool cmGlobalVisualStudioGenerator::TargetIsCSharpOnly( if (!gt->GetConfigCommonSourceFiles(sources)) { return false; } + // Only "real" targets are allowed to be C# targets. + if (gt->Target->GetType() > cmStateEnums::OBJECT_LIBRARY) { + return false; + } } gt->GetLanguages(languages, ""); if (languages.size() == 1) { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 44c390c..7077bbb 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -214,14 +214,7 @@ void cmLocalGenerator::TraceDependencies() void cmLocalGenerator::GenerateTestFiles() { - std::string file = this->StateSnapshot.GetDirectory().GetCurrentBinary(); - file += "/"; - file += "CTestTestfile.cmake"; - if (!this->Makefile->IsOn("CMAKE_TESTING_ENABLED")) { - if (cmSystemTools::FileExists(file)) { - cmSystemTools::RemoveFile(file); - } return; } @@ -230,6 +223,10 @@ void cmLocalGenerator::GenerateTestFiles() const std::string& config = this->Makefile->GetConfigurations(configurationTypes, false); + std::string file = this->StateSnapshot.GetDirectory().GetCurrentBinary(); + file += "/"; + file += "CTestTestfile.cmake"; + cmGeneratedFileStream fout(file.c_str()); fout.SetCopyIfDifferent(true); diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index b172478..4fc664d 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -753,11 +753,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()) + @@ -1048,8 +1047,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())); } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 2e2c53d..d57b8f7 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -405,7 +405,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) std::string rspcontent; std::string responseFlag; - if (lang != "RC" && this->ForceResponseFile()) { + bool const lang_supports_response = !(lang == "RC" || lang == "CUDA"); + if (lang_supports_response && this->ForceResponseFile()) { rspfile = "$RSP_FILE"; responseFlag = "@" + rspfile; rspcontent = " $DEFINES $INCLUDES $FLAGS"; @@ -930,9 +931,10 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( this->SetMsvcTargetPdbVariable(vars); - bool const isRC = (language == "RC"); + bool const lang_supports_response = + !(language == "RC" || language == "CUDA"); int const commandLineLengthLimit = - ((!isRC && this->ForceResponseFile())) ? -1 : 0; + ((lang_supports_response && this->ForceResponseFile())) ? -1 : 0; std::string const rspfile = objectFileName + ".rsp"; this->GetGlobalGenerator()->WriteBuild( |