summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-15 15:48:22 -0500
committerBrad King <brad.king@kitware.com>2022-02-15 17:17:49 -0500
commit42590df9f9fe07ba2aa0bbc19069a6f8cf561cb1 (patch)
tree222410604fd692ff61491f3d9a0860ada9a3c166
parente5a5f3b76fd89a8e98c981012714f94a1d984ad8 (diff)
downloadcmake-42590df9f9fe07ba2aa0bbc19069a6f8cf561cb1.tar.gz
target_link_libraries: Remove likely-broken ancient compatibility check
Since commit daa6d2bc04 (ENH: updated handling of debug and optimized target link libraries, 2006-11-29, v2.6.0~2471) the ancient `<lib>_LINK_TYPE` compatibility lookup was done using the name of the dependent target for which `target_link_libraries` is called, rather than the name of the library dependency being considered. This code probably does nothing. Remove it.
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx21
1 files changed, 3 insertions, 18 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index e15c9418ac..38b1601d0e 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -271,25 +271,10 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
if (!tll.HandleLibrary(currentProcessingState, args[i], llt)) {
return false;
}
- } else {
- // Lookup old-style cache entry if type is unspecified. So if you
- // do a target_link_libraries(foo optimized bar) it will stay optimized
- // and not use the lookup. As there may be the case where someone has
- // specified that a library is both debug and optimized. (this check is
- // only there for backwards compatibility when mixing projects built
- // with old versions of CMake and new)
llt = GENERAL_LibraryType;
- std::string linkType = cmStrCat(args[0], "_LINK_TYPE");
- cmValue linkTypeString = mf.GetDefinition(linkType);
- if (linkTypeString) {
- if (*linkTypeString == "debug") {
- llt = DEBUG_LibraryType;
- }
- if (*linkTypeString == "optimized") {
- llt = OPTIMIZED_LibraryType;
- }
- }
- if (!tll.HandleLibrary(currentProcessingState, args[i], llt)) {
+ } else {
+ if (!tll.HandleLibrary(currentProcessingState, args[i],
+ GENERAL_LibraryType)) {
return false;
}
}