diff options
author | Brad King <brad.king@kitware.com> | 2017-05-19 18:19:50 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-05-19 18:20:11 (GMT) |
commit | 6867b882ec2167f6da5d9cdc22409eb7acba179d (patch) | |
tree | 1383559d18130f9ffbbb4e81c22e8b5b160de7c8 /Source | |
parent | 555f234fa28b1dde4edfaca644de680391941cd4 (diff) | |
parent | 87a37e647587d4891b36db92bd33950ccc864c6b (diff) | |
download | CMake-6867b882ec2167f6da5d9cdc22409eb7acba179d.zip CMake-6867b882ec2167f6da5d9cdc22409eb7acba179d.tar.gz CMake-6867b882ec2167f6da5d9cdc22409eb7acba179d.tar.bz2 |
Merge topic 'target-depends-per-config'
87a37e64 cmComputeTargetDepends: Avoid nested loops over configurations
5a913794 cmComputeTargetDepends: Avoid computing with empty configuration
70c65572 Tests: Fix RunCMake.CMP0022 tll case for Debug configuration
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !865
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 18 | ||||
-rw-r--r-- | Source/cmComputeTargetDepends.h | 1 |
2 files changed, 7 insertions, 12 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index cfebda2..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,15 +294,9 @@ void cmComputeTargetDepends::AddInterfaceDepends( } if (dependee) { - this->AddInterfaceDepends(depender_index, dependee, "", emitted); - std::vector<std::string> configs; - depender->Makefile->GetConfigurations(configs); - 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); } } diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h index ccf99de..e93e376 100644 --- a/Source/cmComputeTargetDepends.h +++ b/Source/cmComputeTargetDepends.h @@ -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, |