mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 05:26:58 +08:00
VS: add missing label in C# project-build events
This commit is contained in:
@@ -570,7 +570,17 @@ public:
|
|||||||
this->First = true;
|
this->First = true;
|
||||||
this->Stream << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"";
|
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)
|
void Write(std::vector<cmCustomCommand> const& ccs)
|
||||||
{
|
{
|
||||||
for (cmCustomCommand const& command : ccs) {
|
for (cmCustomCommand const& command : ccs) {
|
||||||
@@ -1808,6 +1818,7 @@ void cmLocalVisualStudio7Generator::WriteCustomRule(
|
|||||||
if (this->FortranProject) {
|
if (this->FortranProject) {
|
||||||
cmSystemTools::ReplaceString(script, "$(Configuration)", config);
|
cmSystemTools::ReplaceString(script, "$(Configuration)", config);
|
||||||
}
|
}
|
||||||
|
script += this->FinishConstructScript(IsManaged::No);
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
fout << "\t\t\t\t\t<Tool\n"
|
fout << "\t\t\t\t\t<Tool\n"
|
||||||
<< "\t\t\t\t\tName=\"" << customTool << "\"\n"
|
<< "\t\t\t\t\tName=\"" << customTool << "\"\n"
|
||||||
|
@@ -243,3 +243,20 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
|
|||||||
|
|
||||||
return script;
|
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();
|
virtual ~cmLocalVisualStudioGenerator();
|
||||||
|
|
||||||
/** Construct a script from the given list of command lines. */
|
/** Construct a script from the given list of command lines. */
|
||||||
|
enum class IsManaged
|
||||||
|
{
|
||||||
|
No,
|
||||||
|
Yes
|
||||||
|
};
|
||||||
std::string ConstructScript(cmCustomCommandGenerator const& ccg,
|
std::string ConstructScript(cmCustomCommandGenerator const& ccg,
|
||||||
const std::string& newline = "\n");
|
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
|
/** Label to which to jump in a batch file after a failed step in a
|
||||||
sequence of custom commands. */
|
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) {
|
if (this->ProjectType == VsProjectType::csproj) {
|
||||||
std::string name = "CustomCommand_" + c + "_" +
|
std::string name = "CustomCommand_" + c + "_" +
|
||||||
cmSystemTools::ComputeStringMD5(sourcePath);
|
cmSystemTools::ComputeStringMD5(sourcePath);
|
||||||
@@ -4286,6 +4290,12 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
|
|||||||
stdPipesUTF8 = stdPipesUTF8 || cc.GetStdPipesUTF8();
|
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);
|
comment = cmVS10EscapeComment(comment);
|
||||||
if (this->ProjectType != VsProjectType::csproj) {
|
if (this->ProjectType != VsProjectType::csproj) {
|
||||||
Elem e2(e1, name);
|
Elem e2(e1, name);
|
||||||
|
Reference in New Issue
Block a user