VS: add missing label in C# project-build events
This commit is contained in:
parent
cd6b084407
commit
dff98aa9ca
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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. */
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user