summaryrefslogtreecommitdiff
path: root/Source/cmGlobalGenerator.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-15 15:56:49 -0400
committerBrad King <brad.king@kitware.com>2016-09-15 15:56:49 -0400
commitfa3897b24eb9a5cbc4926659b11f8cb6087789a1 (patch)
tree81a3994c80465b330e431cca5ccacb75fd2675bb /Source/cmGlobalGenerator.h
parent916d84450d2caa7cadc82662039602849cdb118d (diff)
downloadcmake-fa3897b24eb9a5cbc4926659b11f8cb6087789a1.tar.gz
cmGlobalGenerator: Refactor global target construction
Avoid using partially-constructed cmTarget instances. Collect the information about how to construct each target in a separate structure and then actually create each cmTarget with full construction.
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r--Source/cmGlobalGenerator.h35
1 files changed, 24 insertions, 11 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 8254809b09..f7b2e59dff 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -402,17 +402,30 @@ protected:
bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
virtual void InitializeProgressMarks() {}
- void CreateDefaultGlobalTargets(cmTargets* targets);
- void AddGlobalTarget_Package(cmTargets* targets);
- void AddGlobalTarget_PackageSource(cmTargets* targets);
- void AddGlobalTarget_Test(cmTargets* targets);
- void AddGlobalTarget_EditCache(cmTargets* targets);
- void AddGlobalTarget_RebuildCache(cmTargets* targets);
- void AddGlobalTarget_Install(cmTargets* targets);
- cmTarget CreateGlobalTarget(const std::string& name, const char* message,
- const cmCustomCommandLines* commandLines,
- std::vector<std::string> depends,
- const char* workingDir, bool uses_terminal);
+
+ struct GlobalTargetInfo
+ {
+ std::string Name;
+ std::string Message;
+ cmCustomCommandLines CommandLines;
+ std::vector<std::string> Depends;
+ std::string WorkingDir;
+ bool UsesTerminal;
+ GlobalTargetInfo()
+ : UsesTerminal(false)
+ {
+ }
+ };
+
+ void CreateDefaultGlobalTargets(std::vector<GlobalTargetInfo>& targets);
+
+ void AddGlobalTarget_Package(std::vector<GlobalTargetInfo>& targets);
+ void AddGlobalTarget_PackageSource(std::vector<GlobalTargetInfo>& targets);
+ void AddGlobalTarget_Test(std::vector<GlobalTargetInfo>& targets);
+ void AddGlobalTarget_EditCache(std::vector<GlobalTargetInfo>& targets);
+ void AddGlobalTarget_RebuildCache(std::vector<GlobalTargetInfo>& targets);
+ void AddGlobalTarget_Install(std::vector<GlobalTargetInfo>& targets);
+ cmTarget CreateGlobalTarget(GlobalTargetInfo const& gti, cmMakefile* mf);
std::string FindMakeProgramFile;
std::string ConfiguredFilesPath;