From 690121f09829a93b815bfb949115fc33f5e4a175 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 15 Oct 2008 10:40:57 -0400 Subject: 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. --- Source/cmLocalUnixMakefileGenerator3.h | 3 +++ Source/cmMakefileTargetGenerator.cxx | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 220aaa8..ebb7c79 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -193,6 +193,9 @@ public: void AppendEcho(std::vector& 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 diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 41e3612..e19cd1d 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -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. -- cgit v0.12