summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-12-09 17:13:42 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2019-12-09 23:24:06 (GMT)
commit36c8cae2e8c23228d3292e77b9bfc65b009bb263 (patch)
treed2dae86bea8247398e6edef358a72cd661e588a7 /Source/cmGlobalGenerator.h
parent352999ac4647d6c5b0d81890df4531d677532843 (diff)
downloadCMake-36c8cae2e8c23228d3292e77b9bfc65b009bb263.zip
CMake-36c8cae2e8c23228d3292e77b9bfc65b009bb263.tar.gz
CMake-36c8cae2e8c23228d3292e77b9bfc65b009bb263.tar.bz2
cmLocalGenerator: modernize memory management
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r--Source/cmGlobalGenerator.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 0e87357..952b51e 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -90,11 +90,14 @@ struct GeneratedMakeCommand
class cmGlobalGenerator
{
public:
+ using LocalGeneratorVector = std::vector<std::unique_ptr<cmLocalGenerator>>;
+
//! Free any memory allocated with the GlobalGenerator
cmGlobalGenerator(cmake* cm);
virtual ~cmGlobalGenerator();
- virtual cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf);
+ virtual std::unique_ptr<cmLocalGenerator> CreateLocalGenerator(
+ cmMakefile* mf);
//! Get the name for this generator
virtual std::string GetName() const { return "Generic"; }
@@ -249,7 +252,7 @@ public:
{
return this->Makefiles;
}
- const std::vector<cmLocalGenerator*>& GetLocalGenerators() const
+ const LocalGeneratorVector& GetLocalGenerators() const
{
return this->LocalGenerators;
}
@@ -477,12 +480,11 @@ public:
int RecursionDepth;
protected:
- using GeneratorVector = std::vector<cmLocalGenerator*>;
// for a project collect all its targets by following depend
// information, and also collect all the targets
void GetTargetSets(TargetDependSet& projectTargets,
TargetDependSet& originalTargets, cmLocalGenerator* root,
- GeneratorVector const&);
+ std::vector<cmLocalGenerator*>& generators);
bool IsRootOnlyTarget(cmGeneratorTarget* target) const;
void AddTargetDepends(const cmGeneratorTarget* target,
TargetDependSet& projectTargets);
@@ -541,7 +543,7 @@ protected:
std::string ConfiguredFilesPath;
cmake* CMakeInstance;
std::vector<cmMakefile*> Makefiles;
- std::vector<cmLocalGenerator*> LocalGenerators;
+ LocalGeneratorVector LocalGenerators;
cmMakefile* CurrentConfigureMakefile;
// map from project name to vector of local generators in that project
std::map<std::string, std::vector<cmLocalGenerator*>> ProjectMap;