diff options
author | Brad King <brad.king@kitware.com> | 2007-12-23 20:03:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-12-23 20:03:42 (GMT) |
commit | 430296dc962bad3ada1e9174f529a53ca676c7df (patch) | |
tree | 2a1f617739038882e0bd01ced9f9dc681a60a1f5 /Source/cmGlobalGenerator.h | |
parent | 8769444beb9686c8214589d447381ce8686284e9 (diff) | |
download | CMake-430296dc962bad3ada1e9174f529a53ca676c7df.zip CMake-430296dc962bad3ada1e9174f529a53ca676c7df.tar.gz CMake-430296dc962bad3ada1e9174f529a53ca676c7df.tar.bz2 |
ENH: Moved global inter-target dependency analysis and cycle-prevention code up from cmGlobalUnixMakefileGenerator3 to cmGlobalGenerator. Simplified cmGlobalUnixMakefileGenerator3 to use it. Later other generators may be modified to use it also.
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r-- | Source/cmGlobalGenerator.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index dff2ca7..edb2019 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -223,8 +223,11 @@ public: virtual const char* GetRebuildCacheTargetName() { return 0; } virtual const char* GetCleanTargetName() { return 0; } + // Class to track a set of dependencies. + class TargetDependSet: public std::set<cmTarget const*> {}; + // what targets does the specified target depend on - std::vector<cmTarget *>& GetTargetDepends(cmTarget& target); + TargetDependSet const& GetTargetDepends(cmTarget const& target); const std::map<cmStdString, std::vector<cmLocalGenerator*> >& GetProjectMap() const {return this->ProjectMap;} @@ -260,7 +263,8 @@ protected: cmLocalGenerator* CurrentLocalGenerator; // map from project name to vector of local generators in that project std::map<cmStdString, std::vector<cmLocalGenerator*> > ProjectMap; - std::map<cmLocalGenerator*, std::set<cmTarget*> > LocalGeneratorToTargetMap; + std::map<cmLocalGenerator*, std::set<cmTarget const*> > + LocalGeneratorToTargetMap; // Set of named installation components requested by the project. std::set<cmStdString> InstallComponents; @@ -286,13 +290,20 @@ private: // this is used to improve performance std::map<cmStdString,cmTarget *> TotalTargets; std::map<cmStdString,cmTarget *> ImportedTotalTargets; - - std::map<cmStdString, std::vector<cmTarget *> > TargetDependencies; cmExternalMakefileProjectGenerator* ExtraGenerator; // track files replaced during a Generate std::vector<std::string> FilesReplacedDuringGenerate; + + // Track inter-target dependencies. + bool ConsiderTargetDepends(cmTarget const* depender, + TargetDependSet& depender_depends, + const char* dependee_name); + bool FindDependency(cmTarget const* goal, cmTarget const* current, + std::vector<cmTarget const*>& steps); + typedef std::map<cmTarget const*, TargetDependSet> TargetDependMap; + TargetDependMap TargetDependencies; }; #endif |