diff options
author | Brad King <brad.king@kitware.com> | 2009-06-25 13:58:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-06-25 13:58:51 (GMT) |
commit | cd83f1979da5c2ed39e5824de70f2d84b8b1a4cc (patch) | |
tree | 4a19dcf2aa834fd8bfe4629dce874c17c4e05dca /Source/cmGlobalUnixMakefileGenerator3.h | |
parent | b9a98ef65b2c586d593219256a05a09c71216eee (diff) | |
download | CMake-cd83f1979da5c2ed39e5824de70f2d84b8b1a4cc.zip CMake-cd83f1979da5c2ed39e5824de70f2d84b8b1a4cc.tar.gz CMake-cd83f1979da5c2ed39e5824de70f2d84b8b1a4cc.tar.bz2 |
ENH: Cleanup make progress rule generation code
This cleans up the Makefile generator's progress rule code. Instead of
keeping every cmMakefileTargetGenerator instance alive to generate
progress, we keep only the information necessary in a single table.
This approach keeps most of the code in cmGlobalUnixMakefileGenerator3,
thus simplifying its public interface.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.h')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 5cfe26f..d21b3e8 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -20,6 +20,7 @@ #include "cmGlobalGenerator.h" class cmGeneratedFileStream; +class cmMakefileTargetGenerator; class cmLocalUnixMakefileGenerator3; /** \class cmGlobalUnixMakefileGenerator3 @@ -113,11 +114,8 @@ public: const char *targetName, const char* config, bool ignoreErrors, bool fast); - // returns some progress informaiton - int GetTargetTotalNumberOfActions(cmTarget & target, - std::set<cmTarget *> &emitted); - unsigned long GetNumberOfProgressActionsInAll - (cmLocalUnixMakefileGenerator3 *lg); + /** Record per-target progress information. */ + void RecordTargetProgress(cmMakefileTargetGenerator* tg); /** * If true, the CMake variable CMAKE_VERBOSE_MAKEFILES doesn't have effect @@ -177,6 +175,22 @@ protected: std::string EmptyRuleHackCommand; bool ForceVerboseMakefiles; + + // Store per-target progress counters. + struct TargetProgress + { + TargetProgress(): NumberOfActions(0) {} + unsigned long NumberOfActions; + std::string VariableFile; + std::vector<int> Marks; + void WriteProgressVariables(unsigned long total, unsigned long& current); + }; + typedef std::map<cmStdString, TargetProgress> ProgressMapType; + ProgressMapType ProgressMap; + + size_t CountProgressMarksInTarget(cmTarget* target, + std::set<cmTarget*>& emitted); + size_t CountProgressMarksInAll(cmLocalUnixMakefileGenerator3* lg); }; #endif |