diff options
author | Brad King <brad.king@kitware.com> | 2009-03-16 20:22:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-16 20:22:19 (GMT) |
commit | 2f651c2e59d4b4fcb46ac6ad293332db99f430f3 (patch) | |
tree | 54474c321bc5ff0381ad70bc419a2e3e8bc41ac1 /Source/cmMakefileTargetGenerator.cxx | |
parent | 741ae600c411f9226b5e44dfd7319741987d5181 (diff) | |
download | CMake-2f651c2e59d4b4fcb46ac6ad293332db99f430f3.zip CMake-2f651c2e59d4b4fcb46ac6ad293332db99f430f3.tar.gz CMake-2f651c2e59d4b4fcb46ac6ad293332db99f430f3.tar.bz2 |
ENH: Allow projects to disable per-rule progress
This creates global property RULE_PROGRESS which can be set to disbale
per-rule progress reporting. On Windows, progress reports may cause a
noticable delay due to the cost of starting an extra process. This
feature will allow scripted builds to avoid the cost since they do not
need detailed progress anyway. See issue #8726.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index b8b9141..b88abed 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -46,6 +46,12 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target) this->GlobalGenerator = static_cast<cmGlobalUnixMakefileGenerator3*>( this->LocalGenerator->GetGlobalGenerator()); + cmake* cm = this->GlobalGenerator->GetCMakeInstance(); + this->NoRuleProgress = false; + if(const char* ruleProgress = cm->GetProperty("RULE_PROGRESS")) + { + this->NoRuleProgress = cmSystemTools::IsOff(ruleProgress); + } } cmMakefileTargetGenerator * @@ -195,15 +201,18 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKEFILE) << "\n\n"; - - // Include the progress variables for the target. - *this->BuildFileStream - << "# Include the progress variables for this target.\n" - << this->LocalGenerator->IncludeDirective << " " - << this->Convert(this->ProgressFileNameFull.c_str(), - cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE) - << "\n\n"; + + if(!this->NoRuleProgress) + { + // Include the progress variables for the target. + *this->BuildFileStream + << "# Include the progress variables for this target.\n" + << this->LocalGenerator->IncludeDirective << " " + << this->Convert(this->ProgressFileNameFull.c_str(), + cmLocalGenerator::HOME_OUTPUT, + cmLocalGenerator::MAKEFILE) + << "\n\n"; + } // make sure the depend file exists if (!cmSystemTools::FileExists(dependFileNameFull.c_str())) @@ -1200,6 +1209,10 @@ void cmMakefileTargetGenerator::AppendProgress(std::vector<std::string>& commands) { this->NumberOfProgressActions++; + if(this->NoRuleProgress) + { + return; + } std::string progressDir = this->Makefile->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); cmOStringStream progCmd; |