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 | |
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
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 18 | ||||
-rw-r--r-- | Source/cmComputeTargetDepends.h | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake | 2 |
4 files changed, 11 insertions, 14 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, diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt index f672285..5d39214 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt @@ -4,13 +4,13 @@ CMake Warning \(dev\) in CMakeLists.txt: cmake_policy command to set the policy and suppress this warning. Target "bar" has an INTERFACE_LINK_LIBRARIES property which differs from - its LINK_INTERFACE_LIBRARIES properties. + its LINK_INTERFACE_LIBRARIES(_DEBUG)? properties. INTERFACE_LINK_LIBRARIES: foo - LINK_INTERFACE_LIBRARIES: + LINK_INTERFACE_LIBRARIES(_DEBUG)?: bat diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake index 11b4e22..03223e8 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake @@ -5,7 +5,9 @@ add_library(foo SHARED empty_vs6_1.cpp) add_library(bar SHARED empty_vs6_2.cpp) add_library(bat SHARED empty_vs6_3.cpp) target_link_libraries(bar LINK_PUBLIC foo) +# Replace the compatibility values set by target_link_libraries set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat) +set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES_DEBUG bat) add_library(user SHARED empty.cpp) target_link_libraries(user bar) |