BUG: Fix color check for dependency scanning

Generation of color rules for dependency scanning messages did not
account for disabling color at generation time.  See issue #7814.
This commit is contained in:
Brad King 2008-10-15 10:40:57 -04:00
parent 9c29a72fbc
commit 690121f098
2 changed files with 8 additions and 2 deletions

View File

@ -193,6 +193,9 @@ public:
void AppendEcho(std::vector<std::string>& commands, const char* text,
EchoColor color = EchoNormal);
/** Get whether the makefile is to have color. */
bool GetColorMakefile() const { return this->ColorMakefile; }
virtual std::string GetTargetDirectory(cmTarget const& target) const;
// create a command that cds to the start dir then runs the commands

View File

@ -1031,8 +1031,11 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
<< " "
<< this->Convert(this->InfoFileNameFull.c_str(),
cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
<< " --color=$(COLOR)";
cmLocalGenerator::FULL, cmLocalGenerator::SHELL);
if(this->LocalGenerator->GetColorMakefile())
{
depCmd << " --color=$(COLOR)";
}
commands.push_back(depCmd.str());
// Make sure all custom command outputs in this target are built.