summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeTargetDepends.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-25 12:34:38 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-02 21:14:02 (GMT)
commit869328aac31f8e702ac7039ce72c6fa485432733 (patch)
tree1f4d0c554be7ef4340f900d43785e5eaf11e812c /Source/cmComputeTargetDepends.cxx
parentaa0a3562dd47bdd6d9ca3058bd1dfd525e79d36d (diff)
downloadCMake-869328aac31f8e702ac7039ce72c6fa485432733.zip
CMake-869328aac31f8e702ac7039ce72c6fa485432733.tar.gz
CMake-869328aac31f8e702ac7039ce72c6fa485432733.tar.bz2
cmComputeTargetDepends: Use valid config to compute target depends.
If CMAKE_BUILD_TYPE is set, and user code contains: target_link_libraries(myexe prefix_$<$<CONFIG:Debug>:debug>) then the computation with an empty config was computing a target-level dependency on a target or library called prefix_, and a dependency on a target or library called prefix_debug (as expected). The existing logic skips 'prefix_' because it is not a known target, and defers to the link-dependencies logic to find the library. The link-dependencies logic does not incorrectly handle the config as cmComputeTargetDepends did, and so did not encounter 'prefix_' during its computation. This likely had no effect on the generated buildsystem.
Diffstat (limited to 'Source/cmComputeTargetDepends.cxx')
-rw-r--r--Source/cmComputeTargetDepends.cxx21
1 files changed, 4 insertions, 17 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index db8b7f3..f07bccb 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -241,25 +241,12 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
}
}
}
- {
- std::vector<std::string> tlibs;
- depender->GetDirectLinkLibraries("", tlibs, depender);
- // A target should not depend on itself.
- emitted.insert(depender->GetName());
- for(std::vector<std::string>::const_iterator lib = tlibs.begin();
- lib != tlibs.end(); ++lib)
- {
- // 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,
- true, emitted);
- }
- }
- }
std::vector<std::string> configs;
depender->GetMakefile()->GetConfigurations(configs);
+ if (configs.empty())
+ {
+ configs.push_back("");
+ }
for (std::vector<std::string>::const_iterator it = configs.begin();
it != configs.end(); ++it)
{