summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Boswell <ulatekh@yahoo.com>2021-12-15 18:11:48 (GMT)
committerSteven Boswell <ulatekh@yahoo.com>2021-12-15 18:11:48 (GMT)
commitdff98aa9ca68cf876a4ac5e73ccd1aa9b5a30da7 (patch)
tree82c26ec566af73a7125e56edf90a74010f52ae7b
parentcd6b08440752f335f01c3419417dc817d20423ec (diff)
downloadCMake-dff98aa9ca68cf876a4ac5e73ccd1aa9b5a30da7.zip
CMake-dff98aa9ca68cf876a4ac5e73ccd1aa9b5a30da7.tar.gz
CMake-dff98aa9ca68cf876a4ac5e73ccd1aa9b5a30da7.tar.bz2
VS: add missing label in C# project-build events
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx13
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx17
-rw-r--r--Source/cmLocalVisualStudioGenerator.h7
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx10
4 files changed, 46 insertions, 1 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index c40e33e..ba8e6e3 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -570,7 +570,17 @@ public:
this->First = true;
this->Stream << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"";
}
- void Finish() { this->Stream << (this->First ? "" : "\"") << "/>\n"; }
+ void Finish()
+ {
+ // If any commands were generated, finish constructing them.
+ if (!this->First) {
+ std::string finishScript =
+ this->LG->FinishConstructScript(IsManaged::No);
+ this->Stream << this->LG->EscapeForXML(finishScript) << "\"";
+ }
+
+ this->Stream << "/>\n";
+ }
void Write(std::vector<cmCustomCommand> const& ccs)
{
for (cmCustomCommand const& command : ccs) {
@@ -1808,6 +1818,7 @@ void cmLocalVisualStudio7Generator::WriteCustomRule(
if (this->FortranProject) {
cmSystemTools::ReplaceString(script, "$(Configuration)", config);
}
+ script += this->FinishConstructScript(IsManaged::No);
/* clang-format off */
fout << "\t\t\t\t\t<Tool\n"
<< "\t\t\t\t\tName=\"" << customTool << "\"\n"
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index ee7e77f..f696dea 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -243,3 +243,20 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
return script;
}
+
+std::string cmLocalVisualStudioGenerator::FinishConstructScript(
+ IsManaged isManaged, const std::string& newline)
+{
+ bool useLocal = this->CustomCommandUseLocal();
+
+ // Store the script in a string.
+ std::string script;
+
+ if (useLocal && isManaged == IsManaged::Yes) {
+ // These aren't generated by default for C# projects.
+ script += newline;
+ script += this->GetReportErrorLabel();
+ }
+
+ return script;
+}
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 91fb6b0..2383a5a 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -31,8 +31,15 @@ public:
virtual ~cmLocalVisualStudioGenerator();
/** Construct a script from the given list of command lines. */
+ enum class IsManaged
+ {
+ No,
+ Yes
+ };
std::string ConstructScript(cmCustomCommandGenerator const& ccg,
const std::string& newline = "\n");
+ std::string FinishConstructScript(IsManaged isManaged,
+ const std::string& newline = "\n");
/** Label to which to jump in a batch file after a failed step in a
sequence of custom commands. */
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 5bec7d3..050cc53 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1571,6 +1571,10 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
}
}
}
+ cmLocalVisualStudioGenerator::IsManaged isManaged = (this->Managed)
+ ? cmLocalVisualStudioGenerator::IsManaged::Yes
+ : cmLocalVisualStudioGenerator::IsManaged::No;
+ script += lg->FinishConstructScript(isManaged);
if (this->ProjectType == VsProjectType::csproj) {
std::string name = "CustomCommand_" + c + "_" +
cmSystemTools::ComputeStringMD5(sourcePath);
@@ -4286,6 +4290,12 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
stdPipesUTF8 = stdPipesUTF8 || cc.GetStdPipesUTF8();
}
}
+ if (!script.empty()) {
+ cmLocalVisualStudioGenerator::IsManaged isManaged = (this->Managed)
+ ? cmLocalVisualStudioGenerator::IsManaged::Yes
+ : cmLocalVisualStudioGenerator::IsManaged::No;
+ script += lg->FinishConstructScript(isManaged);
+ }
comment = cmVS10EscapeComment(comment);
if (this->ProjectType != VsProjectType::csproj) {
Elem e2(e1, name);