| 942 | } |
| 943 | |
| 944 | void cmComputeLinkDepends::AddVarLinkEntries( |
| 945 | cm::optional<size_t> depender_index, char const* value) |
| 946 | { |
| 947 | // This is called to add the dependencies named by |
| 948 | // <item>_LIB_DEPENDS. The variable contains a semicolon-separated |
| 949 | // list. The list contains link-type;item pairs and just items. |
| 950 | cmList deplist{ value }; |
| 951 | |
| 952 | // Look for entries meant for this configuration. |
| 953 | std::vector<cmLinkItem> actual_libs; |
| 954 | cmTargetLinkLibraryType llt = GENERAL_LibraryType; |
| 955 | bool haveLLT = false; |
| 956 | for (std::string const& d : deplist) { |
| 957 | if (d == "debug") { |
| 958 | llt = DEBUG_LibraryType; |
| 959 | haveLLT = true; |
| 960 | } else if (d == "optimized") { |
| 961 | llt = OPTIMIZED_LibraryType; |
| 962 | haveLLT = true; |
| 963 | } else if (d == "general") { |
| 964 | llt = GENERAL_LibraryType; |
| 965 | haveLLT = true; |
| 966 | } else if (!d.empty()) { |
| 967 | // If no explicit link type was given prior to this entry then |
| 968 | // check if the entry has its own link type variable. This is |
| 969 | // needed for compatibility with dependency files generated by |
| 970 | // the export_library_dependencies command from CMake 2.4 and |
| 971 | // lower. |
| 972 | if (!haveLLT) { |
| 973 | std::string var = cmStrCat(d, "_LINK_TYPE"); |
| 974 | if (cmValue val = this->Makefile->GetDefinition(var)) { |
| 975 | if (*val == "debug") { |
| 976 | llt = DEBUG_LibraryType; |
| 977 | } else if (*val == "optimized") { |
| 978 | llt = OPTIMIZED_LibraryType; |
| 979 | } |
| 980 | } |
| 981 | } |
| 982 | |
| 983 | // If the library is meant for this link type then use it. |
| 984 | if (llt == GENERAL_LibraryType || llt == this->LinkType) { |
| 985 | actual_libs.emplace_back(this->ResolveLinkItem(depender_index, d)); |
| 986 | } |
| 987 | |
| 988 | // Reset the link type until another explicit type is given. |
| 989 | llt = GENERAL_LibraryType; |
| 990 | haveLLT = false; |
| 991 | } |
| 992 | } |
| 993 | |
| 994 | // Add the entries from this list. |
| 995 | this->AddLinkEntries(depender_index, actual_libs); |
| 996 | } |
| 997 | |
| 998 | void cmComputeLinkDepends::AddDirectLinkEntries() |
| 999 | { |
no test coverage detected