| 161 | } |
| 162 | |
| 163 | bool processSources(cmGeneratorTarget const* tgt, |
| 164 | EvaluatedTargetPropertyEntries& entries, |
| 165 | std::vector<BT<std::string>>& srcs, |
| 166 | std::unordered_set<std::string>& uniqueSrcs, |
| 167 | bool debugSources) |
| 168 | { |
| 169 | cmMakefile* mf = tgt->Target->GetMakefile(); |
| 170 | |
| 171 | bool contextDependent = entries.HadContextSensitiveCondition; |
| 172 | |
| 173 | for (EvaluatedTargetPropertyEntry& entry : entries.Entries) { |
| 174 | if (entry.ContextDependent) { |
| 175 | contextDependent = true; |
| 176 | } |
| 177 | |
| 178 | cmLinkItem const& item = entry.LinkItem; |
| 179 | std::string const& targetName = item.AsStr(); |
| 180 | |
| 181 | for (std::string& src : entry.Values) { |
| 182 | cmSourceFile* sf = mf->GetOrCreateSource(src); |
| 183 | std::string e; |
| 184 | std::string w; |
| 185 | std::string fullPath = sf->ResolveFullPath(&e, &w); |
| 186 | cmake* cm = tgt->GetLocalGenerator()->GetCMakeInstance(); |
| 187 | if (!w.empty()) { |
| 188 | cm->IssueMessage(MessageType::AUTHOR_WARNING, w, entry.Backtrace); |
| 189 | } |
| 190 | if (fullPath.empty()) { |
| 191 | if (!e.empty()) { |
| 192 | cm->IssueMessage(MessageType::FATAL_ERROR, e, entry.Backtrace); |
| 193 | } |
| 194 | return contextDependent; |
| 195 | } |
| 196 | |
| 197 | if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src)) { |
| 198 | std::ostringstream err; |
| 199 | if (!targetName.empty()) { |
| 200 | err << "Target \"" << targetName |
| 201 | << "\" contains relative path in its INTERFACE_SOURCES:\n \"" |
| 202 | << src << "\""; |
| 203 | } else { |
| 204 | err << "Found relative path while evaluating sources of \"" |
| 205 | << tgt->GetName() << "\":\n \"" << src << "\"\n"; |
| 206 | } |
| 207 | tgt->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR, |
| 208 | err.str()); |
| 209 | return contextDependent; |
| 210 | } |
| 211 | src = fullPath; |
| 212 | } |
| 213 | std::string usedSources; |
| 214 | for (std::string const& src : entry.Values) { |
| 215 | if (uniqueSrcs.insert(src).second) { |
| 216 | srcs.emplace_back(src, entry.Backtrace); |
| 217 | if (debugSources) { |
| 218 | usedSources += cmStrCat(" * ", src, '\n'); |
| 219 | } |
| 220 | } |
no test coverage detected
searching dependent graphs…