VS: Add missing label in C# project-build events

Fixes: #21440
This commit is contained in:
Steven Boswell
2021-09-03 14:06:27 -07:00
committed by Brad King
parent ed9abd9977
commit b284a21fee
4 changed files with 26 additions and 5 deletions

View File

@@ -124,7 +124,8 @@ const char* cmLocalVisualStudioGenerator::GetReportErrorLabel() const
}
std::string cmLocalVisualStudioGenerator::ConstructScript(
cmCustomCommandGenerator const& ccg, const std::string& newline_text)
cmCustomCommandGenerator const& ccg, IsManaged isManaged,
const std::string& newline_text)
{
bool useLocal = this->CustomCommandUseLocal();
std::string workingDirectory = ccg.GetWorkingDirectory();
@@ -236,6 +237,14 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
script += newline;
script += "if %errorlevel% neq 0 goto ";
script += this->GetReportErrorLabel();
if (isManaged == managed) {
// These aren't generated by default for C# projects.
script += newline;
script += this->GetReportErrorLabel();
script += newline;
script += "exit /b 0";
script += newline;
}
}
return script;