mirror of
https://github.com/reactos/CMake.git
synced 2024-11-24 12:09:48 +00:00
cmComputeTargetDepends: Avoid nested loops over configurations
`AddInterfaceDepends` is only called from `CollectTargetDepends` inside our loop over all configurations so it doesn't need its own such loop.
This commit is contained in:
parent
5a913794d2
commit
87a37e6475
@ -238,7 +238,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
|
||||
// Don't emit the same library twice for this target.
|
||||
if (emitted.insert(*lib).second) {
|
||||
this->AddTargetDepend(depender_index, *lib, true);
|
||||
this->AddInterfaceDepends(depender_index, *lib, emitted);
|
||||
this->AddInterfaceDepends(depender_index, *lib, *it, emitted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -273,7 +273,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(
|
||||
// Don't emit the same library twice for this target.
|
||||
if (emitted.insert(*lib).second) {
|
||||
this->AddTargetDepend(depender_index, *lib, true);
|
||||
this->AddInterfaceDepends(depender_index, *lib, emitted);
|
||||
this->AddInterfaceDepends(depender_index, *lib, config, emitted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -281,7 +281,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(
|
||||
|
||||
void cmComputeTargetDepends::AddInterfaceDepends(
|
||||
int depender_index, cmLinkItem const& dependee_name,
|
||||
std::set<std::string>& emitted)
|
||||
const std::string& config, std::set<std::string>& emitted)
|
||||
{
|
||||
cmGeneratorTarget const* depender = this->Targets[depender_index];
|
||||
cmGeneratorTarget const* dependee = dependee_name.Target;
|
||||
@ -294,17 +294,9 @@ void cmComputeTargetDepends::AddInterfaceDepends(
|
||||
}
|
||||
|
||||
if (dependee) {
|
||||
std::vector<std::string> configs;
|
||||
depender->Makefile->GetConfigurations(configs);
|
||||
if (configs.empty()) {
|
||||
configs.push_back("");
|
||||
}
|
||||
for (std::vector<std::string>::const_iterator it = configs.begin();
|
||||
it != configs.end(); ++it) {
|
||||
// A target should not depend on itself.
|
||||
emitted.insert(depender->GetName());
|
||||
this->AddInterfaceDepends(depender_index, dependee, *it, emitted);
|
||||
}
|
||||
// A target should not depend on itself.
|
||||
emitted.insert(depender->GetName());
|
||||
this->AddInterfaceDepends(depender_index, dependee, config, emitted);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@ private:
|
||||
bool linking);
|
||||
bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
|
||||
void AddInterfaceDepends(int depender_index, cmLinkItem const& dependee_name,
|
||||
const std::string& config,
|
||||
std::set<std::string>& emitted);
|
||||
void AddInterfaceDepends(int depender_index,
|
||||
cmGeneratorTarget const* dependee,
|
||||
|
Loading…
Reference in New Issue
Block a user