diff options
author | Brad King <brad.king@kitware.com> | 2016-09-15 19:56:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-15 19:56:49 (GMT) |
commit | fa3897b24eb9a5cbc4926659b11f8cb6087789a1 (patch) | |
tree | 81a3994c80465b330e431cca5ccacb75fd2675bb /Source/cmGlobalGenerator.h | |
parent | 916d84450d2caa7cadc82662039602849cdb118d (diff) | |
download | CMake-fa3897b24eb9a5cbc4926659b11f8cb6087789a1.zip CMake-fa3897b24eb9a5cbc4926659b11f8cb6087789a1.tar.gz CMake-fa3897b24eb9a5cbc4926659b11f8cb6087789a1.tar.bz2 |
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.h | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 8254809..f7b2e59 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; |