ENH: remove const
This commit is contained in:
parent
2a6e918c1f
commit
6903d2df8b
|
@ -1283,14 +1283,14 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
|
||||||
clg = clg->GetParent())
|
clg = clg->GetParent())
|
||||||
{
|
{
|
||||||
// This local generator includes the target.
|
// This local generator includes the target.
|
||||||
std::set<cmTarget const*>& targetSet =
|
std::set<cmTarget*>& targetSet =
|
||||||
this->LocalGeneratorToTargetMap[clg];
|
this->LocalGeneratorToTargetMap[clg];
|
||||||
targetSet.insert(&target);
|
targetSet.insert(&target);
|
||||||
|
|
||||||
// Add dependencies of the included target. An excluded
|
// Add dependencies of the included target. An excluded
|
||||||
// target may still be included if it is a dependency of a
|
// target may still be included if it is a dependency of a
|
||||||
// non-excluded target.
|
// non-excluded target.
|
||||||
TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target);
|
TargetDependSet & tgtdeps = this->GetTargetDirectDepends(target);
|
||||||
for(TargetDependSet::const_iterator ti = tgtdeps.begin();
|
for(TargetDependSet::const_iterator ti = tgtdeps.begin();
|
||||||
ti != tgtdeps.end(); ++ti)
|
ti != tgtdeps.end(); ++ti)
|
||||||
{
|
{
|
||||||
|
@ -1682,14 +1682,14 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*,
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmGlobalGenerator::TargetDependSet const&
|
cmGlobalGenerator::TargetDependSet &
|
||||||
cmGlobalGenerator::GetTargetDirectDepends(cmTarget const& target)
|
cmGlobalGenerator::GetTargetDirectDepends(cmTarget & target)
|
||||||
{
|
{
|
||||||
// Clarify the role of the input target.
|
// Clarify the role of the input target.
|
||||||
cmTarget const* depender = ⌖
|
cmTarget * depender = ⌖
|
||||||
|
|
||||||
// if the depends are already in the map then return
|
// if the depends are already in the map then return
|
||||||
TargetDependMap::const_iterator tgtI =
|
TargetDependMap::iterator tgtI =
|
||||||
this->TargetDependencies.find(depender);
|
this->TargetDependencies.find(depender);
|
||||||
if(tgtI != this->TargetDependencies.end())
|
if(tgtI != this->TargetDependencies.end())
|
||||||
{
|
{
|
||||||
|
@ -1737,12 +1737,12 @@ cmGlobalGenerator::GetTargetDirectDepends(cmTarget const& target)
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
cmGlobalGenerator::ConsiderTargetDepends(cmTarget const* depender,
|
cmGlobalGenerator::ConsiderTargetDepends(cmTarget * depender,
|
||||||
TargetDependSet& depender_depends,
|
TargetDependSet& depender_depends,
|
||||||
const char* dependee_name)
|
const char* dependee_name)
|
||||||
{
|
{
|
||||||
// Check the target's makefile first.
|
// Check the target's makefile first.
|
||||||
cmTarget const* dependee =
|
cmTarget * dependee =
|
||||||
depender->GetMakefile()->FindTarget(dependee_name);
|
depender->GetMakefile()->FindTarget(dependee_name);
|
||||||
|
|
||||||
// Then search globally.
|
// Then search globally.
|
||||||
|
@ -1758,7 +1758,7 @@ cmGlobalGenerator::ConsiderTargetDepends(cmTarget const* depender,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the depender is among the dependee's dependencies.
|
// Check whether the depender is among the dependee's dependencies.
|
||||||
std::vector<cmTarget const*> steps;
|
std::vector<cmTarget *> steps;
|
||||||
if(this->FindDependency(depender, dependee, steps))
|
if(this->FindDependency(depender, dependee, steps))
|
||||||
{
|
{
|
||||||
// This creates a cyclic dependency.
|
// This creates a cyclic dependency.
|
||||||
|
@ -1769,7 +1769,7 @@ cmGlobalGenerator::ConsiderTargetDepends(cmTarget const* depender,
|
||||||
for(unsigned int i = static_cast<unsigned int>(steps.size());
|
for(unsigned int i = static_cast<unsigned int>(steps.size());
|
||||||
i > 0; --i)
|
i > 0; --i)
|
||||||
{
|
{
|
||||||
cmTarget const* step = steps[i-1];
|
cmTarget * step = steps[i-1];
|
||||||
e << " -> " << step->GetName() << "\n";
|
e << " -> " << step->GetName() << "\n";
|
||||||
isStatic = isStatic && step->GetType() == cmTarget::STATIC_LIBRARY;
|
isStatic = isStatic && step->GetType() == cmTarget::STATIC_LIBRARY;
|
||||||
}
|
}
|
||||||
|
@ -1799,21 +1799,21 @@ cmGlobalGenerator::ConsiderTargetDepends(cmTarget const* depender,
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
cmGlobalGenerator
|
cmGlobalGenerator
|
||||||
::FindDependency(cmTarget const* goal, cmTarget const* current,
|
::FindDependency(cmTarget * goal, cmTarget * current,
|
||||||
std::vector<cmTarget const*>& steps)
|
std::vector<cmTarget*>& steps)
|
||||||
{
|
{
|
||||||
if(current == goal)
|
if(current == goal)
|
||||||
{
|
{
|
||||||
steps.push_back(current);
|
steps.push_back(current);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
TargetDependMap::const_iterator i = this->TargetDependencies.find(current);
|
TargetDependMap::iterator i = this->TargetDependencies.find(current);
|
||||||
if(i == this->TargetDependencies.end())
|
if(i == this->TargetDependencies.end())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TargetDependSet const& depends = i->second;
|
TargetDependSet & depends = i->second;
|
||||||
for(TargetDependSet::const_iterator j = depends.begin();
|
for(TargetDependSet::iterator j = depends.begin();
|
||||||
j != depends.end(); ++j)
|
j != depends.end(); ++j)
|
||||||
{
|
{
|
||||||
if(this->FindDependency(goal, *j, steps))
|
if(this->FindDependency(goal, *j, steps))
|
||||||
|
|
|
@ -232,11 +232,11 @@ public:
|
||||||
virtual const char* GetCleanTargetName() { return 0; }
|
virtual const char* GetCleanTargetName() { return 0; }
|
||||||
|
|
||||||
// Class to track a set of dependencies.
|
// Class to track a set of dependencies.
|
||||||
class TargetDependSet: public std::set<cmTarget const*> {};
|
class TargetDependSet: public std::set<cmTarget*> {};
|
||||||
|
|
||||||
// what targets does the specified target depend on directly
|
// what targets does the specified target depend on directly
|
||||||
// via a target_link_libraries or add_dependencies
|
// via a target_link_libraries or add_dependencies
|
||||||
TargetDependSet const& GetTargetDirectDepends(cmTarget const& target);
|
TargetDependSet & GetTargetDirectDepends(cmTarget & target);
|
||||||
|
|
||||||
const std::map<cmStdString, std::vector<cmLocalGenerator*> >& GetProjectMap()
|
const std::map<cmStdString, std::vector<cmLocalGenerator*> >& GetProjectMap()
|
||||||
const {return this->ProjectMap;}
|
const {return this->ProjectMap;}
|
||||||
|
@ -281,7 +281,7 @@ protected:
|
||||||
cmLocalGenerator* CurrentLocalGenerator;
|
cmLocalGenerator* CurrentLocalGenerator;
|
||||||
// map from project name to vector of local generators in that project
|
// map from project name to vector of local generators in that project
|
||||||
std::map<cmStdString, std::vector<cmLocalGenerator*> > ProjectMap;
|
std::map<cmStdString, std::vector<cmLocalGenerator*> > ProjectMap;
|
||||||
std::map<cmLocalGenerator*, std::set<cmTarget const*> >
|
std::map<cmLocalGenerator*, std::set<cmTarget *> >
|
||||||
LocalGeneratorToTargetMap;
|
LocalGeneratorToTargetMap;
|
||||||
|
|
||||||
// Set of named installation components requested by the project.
|
// Set of named installation components requested by the project.
|
||||||
|
@ -314,12 +314,12 @@ private:
|
||||||
std::vector<std::string> FilesReplacedDuringGenerate;
|
std::vector<std::string> FilesReplacedDuringGenerate;
|
||||||
|
|
||||||
// Track inter-target dependencies.
|
// Track inter-target dependencies.
|
||||||
bool ConsiderTargetDepends(cmTarget const* depender,
|
bool ConsiderTargetDepends(cmTarget * depender,
|
||||||
TargetDependSet& depender_depends,
|
TargetDependSet& depender_depends,
|
||||||
const char* dependee_name);
|
const char* dependee_name);
|
||||||
bool FindDependency(cmTarget const* goal, cmTarget const* current,
|
bool FindDependency(cmTarget * goal, cmTarget * current,
|
||||||
std::vector<cmTarget const*>& steps);
|
std::vector<cmTarget *>& steps);
|
||||||
typedef std::map<cmTarget const*, TargetDependSet> TargetDependMap;
|
typedef std::map<cmTarget *, TargetDependSet> TargetDependMap;
|
||||||
TargetDependMap TargetDependencies;
|
TargetDependMap TargetDependencies;
|
||||||
|
|
||||||
// Cache directory content and target files to be built.
|
// Cache directory content and target files to be built.
|
||||||
|
|
|
@ -848,7 +848,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int cmGlobalUnixMakefileGenerator3
|
int cmGlobalUnixMakefileGenerator3
|
||||||
::GetTargetTotalNumberOfActions(cmTarget const& target,
|
::GetTargetTotalNumberOfActions(cmTarget & target,
|
||||||
std::set<cmStdString> &emitted)
|
std::set<cmStdString> &emitted)
|
||||||
{
|
{
|
||||||
// do not double count
|
// do not double count
|
||||||
|
@ -861,9 +861,9 @@ int cmGlobalUnixMakefileGenerator3
|
||||||
(target.GetMakefile()->GetLocalGenerator());
|
(target.GetMakefile()->GetLocalGenerator());
|
||||||
result = static_cast<int>(lg->ProgressFiles[target.GetName()].size());
|
result = static_cast<int>(lg->ProgressFiles[target.GetName()].size());
|
||||||
|
|
||||||
TargetDependSet const& depends = this->GetTargetDirectDepends(target);
|
TargetDependSet & depends = this->GetTargetDirectDepends(target);
|
||||||
|
|
||||||
TargetDependSet::const_iterator i;
|
TargetDependSet::iterator i;
|
||||||
for (i = depends.begin(); i != depends.end(); ++i)
|
for (i = depends.begin(); i != depends.end(); ++i)
|
||||||
{
|
{
|
||||||
result += this->GetTargetTotalNumberOfActions(**i, emitted);
|
result += this->GetTargetTotalNumberOfActions(**i, emitted);
|
||||||
|
@ -877,11 +877,11 @@ unsigned long cmGlobalUnixMakefileGenerator3
|
||||||
::GetNumberOfProgressActionsInAll(cmLocalUnixMakefileGenerator3 *lg)
|
::GetNumberOfProgressActionsInAll(cmLocalUnixMakefileGenerator3 *lg)
|
||||||
{
|
{
|
||||||
unsigned long result = 0;
|
unsigned long result = 0;
|
||||||
std::set<cmTarget const*>& targets = this->LocalGeneratorToTargetMap[lg];
|
std::set<cmTarget *>& targets = this->LocalGeneratorToTargetMap[lg];
|
||||||
for(std::set<cmTarget const*>::iterator t = targets.begin();
|
for(std::set<cmTarget *>::iterator t = targets.begin();
|
||||||
t != targets.end(); ++t)
|
t != targets.end(); ++t)
|
||||||
{
|
{
|
||||||
cmTarget const* target = *t;
|
cmTarget * target = *t;
|
||||||
cmLocalUnixMakefileGenerator3 *lg3 =
|
cmLocalUnixMakefileGenerator3 *lg3 =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>
|
static_cast<cmLocalUnixMakefileGenerator3 *>
|
||||||
(target->GetMakefile()->GetLocalGenerator());
|
(target->GetMakefile()->GetLocalGenerator());
|
||||||
|
|
|
@ -114,7 +114,7 @@ public:
|
||||||
const char* config, bool ignoreErrors, bool fast);
|
const char* config, bool ignoreErrors, bool fast);
|
||||||
|
|
||||||
// returns some progress informaiton
|
// returns some progress informaiton
|
||||||
int GetTargetTotalNumberOfActions(cmTarget const& target,
|
int GetTargetTotalNumberOfActions(cmTarget & target,
|
||||||
std::set<cmStdString> &emitted);
|
std::set<cmStdString> &emitted);
|
||||||
unsigned long GetNumberOfProgressActionsInAll
|
unsigned long GetNumberOfProgressActionsInAll
|
||||||
(cmLocalUnixMakefileGenerator3 *lg);
|
(cmLocalUnixMakefileGenerator3 *lg);
|
||||||
|
|
Loading…
Reference in New Issue