summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-02 15:07:22 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-03-02 15:07:31 (GMT)
commit5fe186ade715b2f8b2fd211589b6042a3e090be7 (patch)
tree88156d8e99d0b50f85d69011c25e067583b687f9 /Source/cmGeneratorTarget.cxx
parent3c7e4867853348bccc5a06e3921bbd9367710c04 (diff)
parentb909be9e230af1767d7fdcb15a5266ab7c25fcfc (diff)
downloadCMake-5fe186ade715b2f8b2fd211589b6042a3e090be7.zip
CMake-5fe186ade715b2f8b2fd211589b6042a3e090be7.tar.gz
CMake-5fe186ade715b2f8b2fd211589b6042a3e090be7.tar.bz2
Merge topic 'target_sources-backtrace'
b909be9e23 target_sources: Fix backtrace on missing source 4a3e79048b Tests: Add RunCMake.target_sources case covering missing source Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !8268
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b078f23..54cd8ba 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1725,7 +1725,8 @@ void addFileSetEntry(cmGeneratorTarget const* headTarget,
std::move(entryCge), fileSet);
entries.Entries.emplace_back(
EvaluateTargetPropertyEntry(headTarget, config, "", dagChecker, tpe));
- for (auto const& file : entries.Entries.back().Values) {
+ EvaluatedTargetPropertyEntry const& entry = entries.Entries.back();
+ for (auto const& file : entry.Values) {
auto* sf = headTarget->Makefile->GetOrCreateSource(file);
if (fileSet->GetType() == "HEADERS"_s) {
sf->SetProperty("HEADER_FILE_ONLY", "TRUE");
@@ -1736,13 +1737,11 @@ void addFileSetEntry(cmGeneratorTarget const* headTarget,
std::string w;
auto path = sf->ResolveFullPath(&e, &w);
if (!w.empty()) {
- cm->IssueMessage(MessageType::AUTHOR_WARNING, w,
- headTarget->GetBacktrace());
+ cm->IssueMessage(MessageType::AUTHOR_WARNING, w, entry.Backtrace);
}
if (path.empty()) {
if (!e.empty()) {
- cm->IssueMessage(MessageType::FATAL_ERROR, e,
- headTarget->GetBacktrace());
+ cm->IssueMessage(MessageType::FATAL_ERROR, e, entry.Backtrace);
}
return;
}
@@ -1817,11 +1816,11 @@ bool processSources(cmGeneratorTarget const* tgt,
std::string fullPath = sf->ResolveFullPath(&e, &w);
cmake* cm = tgt->GetLocalGenerator()->GetCMakeInstance();
if (!w.empty()) {
- cm->IssueMessage(MessageType::AUTHOR_WARNING, w, tgt->GetBacktrace());
+ cm->IssueMessage(MessageType::AUTHOR_WARNING, w, entry.Backtrace);
}
if (fullPath.empty()) {
if (!e.empty()) {
- cm->IssueMessage(MessageType::FATAL_ERROR, e, tgt->GetBacktrace());
+ cm->IssueMessage(MessageType::FATAL_ERROR, e, entry.Backtrace);
}
return contextDependent;
}