diff options
author | Brad King <brad.king@kitware.com> | 2006-05-25 18:16:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-05-25 18:16:19 (GMT) |
commit | ff41664c6bf3ce91e155b08ef23f4f2e061ba857 (patch) | |
tree | c737a34bd9a06ae864fb1980ead761859d706cf3 | |
parent | 9704c8f8c3ddb830eefd06e23d2a64e6b091a5a2 (diff) | |
download | CMake-ff41664c6bf3ce91e155b08ef23f4f2e061ba857.zip CMake-ff41664c6bf3ce91e155b08ef23f4f2e061ba857.tar.gz CMake-ff41664c6bf3ce91e155b08ef23f4f2e061ba857.tar.bz2 |
ENH: Slight improvement in genreation time by recording the setting of CMAKE_COLOR_MAKEFILE in an ivar of each local generator at the beginning of generation. This avoids many repeated table lookups.
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 8 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.h | 6 |
2 files changed, 11 insertions, 3 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. diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 30bd6c7..686687d 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -308,7 +308,11 @@ private: //========================================================================== std::string HomeRelativeOutputPath; - + + /* Copy the setting of CMAKE_COLOR_MAKEFILE from the makefile at the + beginning of generation to avoid many duplicate lookups. */ + bool ColorMakefile; + std::map<cmStdString,std::vector<cmTarget *> > LocalObjectFiles; /* does the work for each target */ |