summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-05-15 13:58:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-05-15 13:58:48 (GMT)
commit19c2f8e1f32973ee14c7ff36998c65e9380f6724 (patch)
tree43dd0ed05a80e536e6b4fb2394c9d83943ed5565 /Source
parentb3958a0a5acc1d8c72b270f83240601bb6d6b3f8 (diff)
parentc773d5b436fcf8e773809e8594eec1ac3701ce82 (diff)
downloadCMake-19c2f8e1f32973ee14c7ff36998c65e9380f6724.zip
CMake-19c2f8e1f32973ee14c7ff36998c65e9380f6724.tar.gz
CMake-19c2f8e1f32973ee14c7ff36998c65e9380f6724.tar.bz2
Merge topic 'cmp0037-message' into release-3.29
c773d5b436 CMP0037: Restore diagnostic message for invalid ALIAS target names Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !9519
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 1606eec..b2ee306 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2730,6 +2730,7 @@ cmGlobalGenerator::SplitFrameworkPath(const std::string& path,
}
static bool RaiseCMP0037Message(cmake* cm, cmTarget* tgt,
+ std::string const& targetNameAsWritten,
std::string const& reason)
{
MessageType messageType = MessageType::AUTHOR_WARNING;
@@ -2750,8 +2751,8 @@ static bool RaiseCMP0037Message(cmake* cm, cmTarget* tgt,
break;
}
if (issueMessage) {
- e << "The target name \"" << tgt->GetName() << "\" is reserved " << reason
- << ".";
+ e << "The target name \"" << targetNameAsWritten << "\" is reserved "
+ << reason << ".";
if (messageType == MessageType::AUTHOR_WARNING) {
e << " It may result in undefined behavior.";
}
@@ -2770,7 +2771,8 @@ bool cmGlobalGenerator::CheckCMP0037(std::string const& targetName,
if (!tgt) {
return true;
}
- return RaiseCMP0037Message(this->GetCMakeInstance(), tgt, reason);
+ return RaiseCMP0037Message(this->GetCMakeInstance(), tgt, targetName,
+ reason);
}
void cmGlobalGenerator::CreateDefaultGlobalTargets(