summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index e1a9a46..ae7cd04 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -48,6 +48,7 @@ cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3()
this->DefineWindowsNULL = false;
this->UnixCD = true;
this->ForceVerboseMakefiles=false;
+ this->ColorMakefile = false;
}
//----------------------------------------------------------------------------
@@ -75,6 +76,10 @@ void cmLocalUnixMakefileGenerator3::Generate()
// Setup our configuration variables for this directory.
this->ConfigureOutputPaths();
+ // Record whether color makefiles are enabled to avoid checking many
+ // times later.
+ this->ColorMakefile = this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE");
+
// Generate the rule files for each target.
cmTargets& targets = this->Makefile->GetTargets();
std::string empty;
@@ -860,8 +865,7 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands,
// Choose the color for the text.
std::string color_name;
#ifdef CMAKE_BUILD_WITH_CMAKE
- if(this->GlobalGenerator->GetToolSupportsColor() &&
- this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE"))
+ if(this->GlobalGenerator->GetToolSupportsColor() && this->ColorMakefile)
{
// See cmake::ExecuteEchoColor in cmake.cxx for these options.
// This color set is readable on both black and white backgrounds.