cmMakefile: Make FindTarget const.
This commit is contained in:
parent
8841d738cc
commit
37554acf43
|
@ -3822,21 +3822,19 @@ const char* cmMakefile::GetFeature(const char* feature, const char* config)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmTarget* cmMakefile::FindTarget(const char* name, bool excludeAliases)
|
cmTarget* cmMakefile::FindTarget(const char* name, bool excludeAliases) const
|
||||||
{
|
{
|
||||||
if (!excludeAliases)
|
if (!excludeAliases)
|
||||||
{
|
{
|
||||||
std::map<std::string, cmTarget*>::iterator i
|
std::map<std::string, cmTarget*>::const_iterator i
|
||||||
= this->AliasTargets.find(name);
|
= this->AliasTargets.find(name);
|
||||||
if (i != this->AliasTargets.end())
|
if (i != this->AliasTargets.end())
|
||||||
{
|
{
|
||||||
return i->second;
|
return i->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmTargets& tgts = this->GetTargets();
|
cmTargets::iterator i = this->Targets.find( name );
|
||||||
|
if ( i != this->Targets.end() )
|
||||||
cmTargets::iterator i = tgts.find ( name );
|
|
||||||
if ( i != tgts.end() )
|
|
||||||
{
|
{
|
||||||
return &i->second;
|
return &i->second;
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,7 +533,7 @@ public:
|
||||||
this->GeneratorTargets = targets;
|
this->GeneratorTargets = targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmTarget* FindTarget(const char* name, bool excludeAliases = false);
|
cmTarget* FindTarget(const char* name, bool excludeAliases = false) const;
|
||||||
|
|
||||||
/** Find a target to use in place of the given name. The target
|
/** Find a target to use in place of the given name. The target
|
||||||
returned may be imported or built within the project. */
|
returned may be imported or built within the project. */
|
||||||
|
@ -902,7 +902,7 @@ protected:
|
||||||
std::string ProjectName; // project name
|
std::string ProjectName; // project name
|
||||||
|
|
||||||
// libraries, classes, and executables
|
// libraries, classes, and executables
|
||||||
cmTargets Targets;
|
mutable cmTargets Targets;
|
||||||
std::map<std::string, cmTarget*> AliasTargets;
|
std::map<std::string, cmTarget*> AliasTargets;
|
||||||
cmGeneratorTargetsType GeneratorTargets;
|
cmGeneratorTargetsType GeneratorTargets;
|
||||||
std::vector<cmSourceFile*> SourceFiles;
|
std::vector<cmSourceFile*> SourceFiles;
|
||||||
|
|
Loading…
Reference in New Issue