Revert "Honor RULE_MESSAGES property for build target messages" (#12190)
This reverts commit dc36b34994
. It broke
dependency logic instead of only silencing messages. Revert to previous
behavior.
This commit is contained in:
parent
dc36b34994
commit
051cee0096
|
@ -25,7 +25,6 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3()
|
||||||
this->FindMakeProgramFile = "CMakeUnixFindMake.cmake";
|
this->FindMakeProgramFile = "CMakeUnixFindMake.cmake";
|
||||||
this->ToolSupportsColor = true;
|
this->ToolSupportsColor = true;
|
||||||
this->ForceVerboseMakefiles = false;
|
this->ForceVerboseMakefiles = false;
|
||||||
this->NoRuleMessages = false;
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__VMS)
|
#if defined(_WIN32) || defined(__VMS)
|
||||||
this->UseLinkScript = false;
|
this->UseLinkScript = false;
|
||||||
|
@ -145,46 +144,37 @@ void cmGlobalUnixMakefileGenerator3::Generate()
|
||||||
// first do superclass method
|
// first do superclass method
|
||||||
this->cmGlobalGenerator::Generate();
|
this->cmGlobalGenerator::Generate();
|
||||||
|
|
||||||
cmake* cm = this->GetCMakeInstance();
|
// initialize progress
|
||||||
if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES"))
|
unsigned long total = 0;
|
||||||
|
for(ProgressMapType::const_iterator pmi = this->ProgressMap.begin();
|
||||||
|
pmi != this->ProgressMap.end(); ++pmi)
|
||||||
{
|
{
|
||||||
this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
|
total += pmi->second.NumberOfActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this->NoRuleMessages)
|
// write each target's progress.make this loop is done twice. Bascially the
|
||||||
|
// Generate pass counts all the actions, the first loop below determines
|
||||||
|
// how many actions have progress updates for each target and writes to
|
||||||
|
// corrrect variable values for everything except the all targets. The
|
||||||
|
// second loop actually writes out correct values for the all targets as
|
||||||
|
// well. This is because the all targets require more information that is
|
||||||
|
// computed in the first loop.
|
||||||
|
unsigned long current = 0;
|
||||||
|
for(ProgressMapType::iterator pmi = this->ProgressMap.begin();
|
||||||
|
pmi != this->ProgressMap.end(); ++pmi)
|
||||||
{
|
{
|
||||||
// initialize progress
|
pmi->second.WriteProgressVariables(total, current);
|
||||||
unsigned long total = 0;
|
}
|
||||||
for(ProgressMapType::const_iterator pmi = this->ProgressMap.begin();
|
for(unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
|
||||||
pmi != this->ProgressMap.end(); ++pmi)
|
{
|
||||||
{
|
cmLocalUnixMakefileGenerator3 *lg =
|
||||||
total += pmi->second.NumberOfActions;
|
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
||||||
}
|
std::string markFileName = lg->GetMakefile()->GetStartOutputDirectory();
|
||||||
|
markFileName += "/";
|
||||||
// write each target's progress.make this loop is done twice. Bascially the
|
markFileName += cmake::GetCMakeFilesDirectory();
|
||||||
// Generate pass counts all the actions, the first loop below determines
|
markFileName += "/progress.marks";
|
||||||
// how many actions have progress updates for each target and writes to
|
cmGeneratedFileStream markFile(markFileName.c_str());
|
||||||
// corrrect variable values for everything except the all targets. The
|
markFile << this->CountProgressMarksInAll(lg) << "\n";
|
||||||
// second loop actually writes out correct values for the all targets as
|
|
||||||
// well. This is because the all targets require more information that is
|
|
||||||
// computed in the first loop.
|
|
||||||
unsigned long current = 0;
|
|
||||||
for(ProgressMapType::iterator pmi = this->ProgressMap.begin();
|
|
||||||
pmi != this->ProgressMap.end(); ++pmi)
|
|
||||||
{
|
|
||||||
pmi->second.WriteProgressVariables(total, current);
|
|
||||||
}
|
|
||||||
for(unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
|
|
||||||
{
|
|
||||||
cmLocalUnixMakefileGenerator3 *lg =
|
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
|
||||||
std::string markFileName = lg->GetMakefile()->GetStartOutputDirectory();
|
|
||||||
markFileName += "/";
|
|
||||||
markFileName += cmake::GetCMakeFilesDirectory();
|
|
||||||
markFileName += "/progress.marks";
|
|
||||||
cmGeneratedFileStream markFile(markFileName.c_str());
|
|
||||||
markFile << this->CountProgressMarksInAll(lg) << "\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the main makefile
|
// write the main makefile
|
||||||
|
@ -748,34 +738,30 @@ cmGlobalUnixMakefileGenerator3
|
||||||
// Write the rule.
|
// Write the rule.
|
||||||
localName += "/all";
|
localName += "/all";
|
||||||
depends.clear();
|
depends.clear();
|
||||||
std::string progressDir;
|
|
||||||
|
|
||||||
if(!this->NoRuleMessages)
|
std::string progressDir =
|
||||||
|
lg->GetMakefile()->GetHomeOutputDirectory();
|
||||||
|
progressDir += cmake::GetCMakeFilesDirectory();
|
||||||
{
|
{
|
||||||
progressDir =
|
cmOStringStream progCmd;
|
||||||
lg->GetMakefile()->GetHomeOutputDirectory();
|
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
|
||||||
progressDir += cmake::GetCMakeFilesDirectory();
|
// all target counts
|
||||||
|
progCmd << lg->Convert(progressDir.c_str(),
|
||||||
|
cmLocalGenerator::FULL,
|
||||||
|
cmLocalGenerator::SHELL);
|
||||||
|
progCmd << " ";
|
||||||
|
std::vector<unsigned long>& progFiles =
|
||||||
|
this->ProgressMap[&t->second].Marks;
|
||||||
|
for (std::vector<unsigned long>::iterator i = progFiles.begin();
|
||||||
|
i != progFiles.end(); ++i)
|
||||||
{
|
{
|
||||||
cmOStringStream progCmd;
|
progCmd << " " << *i;
|
||||||
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
|
|
||||||
// all target counts
|
|
||||||
progCmd << lg->Convert(progressDir.c_str(),
|
|
||||||
cmLocalGenerator::FULL,
|
|
||||||
cmLocalGenerator::SHELL);
|
|
||||||
progCmd << " ";
|
|
||||||
std::vector<unsigned long>& progFiles =
|
|
||||||
this->ProgressMap[&t->second].Marks;
|
|
||||||
for (std::vector<unsigned long>::iterator i = progFiles.begin();
|
|
||||||
i != progFiles.end(); ++i)
|
|
||||||
{
|
|
||||||
progCmd << " " << *i;
|
|
||||||
}
|
|
||||||
commands.push_back(progCmd.str());
|
|
||||||
}
|
}
|
||||||
progressDir = "Built target ";
|
commands.push_back(progCmd.str());
|
||||||
progressDir += t->first;
|
|
||||||
lg->AppendEcho(commands,progressDir.c_str());
|
|
||||||
}
|
}
|
||||||
|
progressDir = "Built target ";
|
||||||
|
progressDir += t->first;
|
||||||
|
lg->AppendEcho(commands,progressDir.c_str());
|
||||||
|
|
||||||
this->AppendGlobalTargetDepends(depends,t->second);
|
this->AppendGlobalTargetDepends(depends,t->second);
|
||||||
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
|
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
|
||||||
|
@ -791,42 +777,38 @@ cmGlobalUnixMakefileGenerator3
|
||||||
"all", depends, commands, true);
|
"all", depends, commands, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this->NoRuleMessages)
|
// Write the rule.
|
||||||
{
|
commands.clear();
|
||||||
// Write the rule.
|
progressDir = lg->GetMakefile()->GetHomeOutputDirectory();
|
||||||
commands.clear();
|
progressDir += cmake::GetCMakeFilesDirectory();
|
||||||
progressDir = lg->GetMakefile()->GetHomeOutputDirectory();
|
|
||||||
progressDir += cmake::GetCMakeFilesDirectory();
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// TODO: Convert the total progress count to a make variable.
|
// TODO: Convert the total progress count to a make variable.
|
||||||
cmOStringStream progCmd;
|
cmOStringStream progCmd;
|
||||||
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
|
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
|
||||||
// # in target
|
// # in target
|
||||||
progCmd << lg->Convert(progressDir.c_str(),
|
progCmd << lg->Convert(progressDir.c_str(),
|
||||||
cmLocalGenerator::FULL,
|
cmLocalGenerator::FULL,
|
||||||
cmLocalGenerator::SHELL);
|
cmLocalGenerator::SHELL);
|
||||||
//
|
//
|
||||||
std::set<cmTarget *> emitted;
|
std::set<cmTarget *> emitted;
|
||||||
progCmd << " "
|
progCmd << " "
|
||||||
<< this->CountProgressMarksInTarget(&t->second, emitted);
|
<< this->CountProgressMarksInTarget(&t->second, emitted);
|
||||||
commands.push_back(progCmd.str());
|
commands.push_back(progCmd.str());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
|
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
|
||||||
tmp += "Makefile2";
|
tmp += "Makefile2";
|
||||||
commands.push_back(lg->GetRecursiveMakeCall
|
commands.push_back(lg->GetRecursiveMakeCall
|
||||||
(tmp.c_str(),localName.c_str()));
|
(tmp.c_str(),localName.c_str()));
|
||||||
if(!this->NoRuleMessages)
|
{
|
||||||
{
|
cmOStringStream progCmd;
|
||||||
cmOStringStream progCmd;
|
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
|
||||||
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
|
progCmd << lg->Convert(progressDir.c_str(),
|
||||||
progCmd << lg->Convert(progressDir.c_str(),
|
cmLocalGenerator::FULL,
|
||||||
cmLocalGenerator::FULL,
|
cmLocalGenerator::SHELL);
|
||||||
cmLocalGenerator::SHELL);
|
progCmd << " 0";
|
||||||
progCmd << " 0";
|
commands.push_back(progCmd.str());
|
||||||
commands.push_back(progCmd.str());
|
}
|
||||||
}
|
|
||||||
depends.clear();
|
depends.clear();
|
||||||
depends.push_back("cmake_check_build_system");
|
depends.push_back("cmake_check_build_system");
|
||||||
localName = lg->GetRelativeTargetDirectory(t->second);
|
localName = lg->GetRelativeTargetDirectory(t->second);
|
||||||
|
|
|
@ -170,7 +170,6 @@ protected:
|
||||||
std::string EmptyRuleHackCommand;
|
std::string EmptyRuleHackCommand;
|
||||||
|
|
||||||
bool ForceVerboseMakefiles;
|
bool ForceVerboseMakefiles;
|
||||||
bool NoRuleMessages;
|
|
||||||
|
|
||||||
// Store per-target progress counters.
|
// Store per-target progress counters.
|
||||||
struct TargetProgress
|
struct TargetProgress
|
||||||
|
|
Loading…
Reference in New Issue