summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeTargetDepends.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-17 17:29:37 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-18 14:18:57 (GMT)
commit87a37e647587d4891b36db92bd33950ccc864c6b (patch)
treeb81f4bbcae0a2b7aac760e81ac6d3d2889094756 /Source/cmComputeTargetDepends.cxx
parent5a913794d2931c3de00464cf261215a173f5ab8b (diff)
downloadCMake-87a37e647587d4891b36db92bd33950ccc864c6b.zip
CMake-87a37e647587d4891b36db92bd33950ccc864c6b.tar.gz
CMake-87a37e647587d4891b36db92bd33950ccc864c6b.tar.bz2
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.
Diffstat (limited to 'Source/cmComputeTargetDepends.cxx')
-rw-r--r--Source/cmComputeTargetDepends.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 8ca8763..ff19eac 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -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);
}
}