summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-10-27 16:58:46 (GMT)
committerBrad King <brad.king@kitware.com>2021-10-27 16:58:46 (GMT)
commit1a25f057da00f79d9e81c64db87a27061d2ed311 (patch)
tree33a11c8754653a094bd19c50a43972760cb66d68 /Source/cmComputeLinkInformation.cxx
parent4862f3b2c88e37187c9a5e323f8881b24dbdabef (diff)
downloadCMake-1a25f057da00f79d9e81c64db87a27061d2ed311.zip
CMake-1a25f057da00f79d9e81c64db87a27061d2ed311.tar.gz
CMake-1a25f057da00f79d9e81c64db87a27061d2ed311.tar.bz2
cmComputeLinkInformation: Add context to warning about linking a directory
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 831a81f..2ff91fe 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -722,7 +722,7 @@ void cmComputeLinkInformation::AddItem(BT<std::string> const& item,
this->AddFrameworkItem(item.Value);
} else if (cmSystemTools::FileIsDirectory(item.Value)) {
// This is a directory.
- this->DropDirectoryItem(item.Value);
+ this->DropDirectoryItem(item);
} else {
// Use the full path given to the library file.
this->Depends.push_back(item.Value);
@@ -1349,16 +1349,17 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
}
}
-void cmComputeLinkInformation::DropDirectoryItem(std::string const& item)
+void cmComputeLinkInformation::DropDirectoryItem(BT<std::string> const& item)
{
// A full path to a directory was found as a link item. Warn the
// user.
- std::ostringstream e;
- e << "WARNING: Target \"" << this->Target->GetName()
- << "\" requests linking to directory \"" << item << "\". "
- << "Targets may link only to libraries. "
- << "CMake is dropping the item.";
- cmSystemTools::Message(e.str());
+ this->CMakeInstance->IssueMessage(
+ MessageType::WARNING,
+ cmStrCat(
+ "Target \"", this->Target->GetName(),
+ "\" requests linking to directory \"", item.Value,
+ "\". Targets may link only to libraries. CMake is dropping the item."),
+ item.Backtrace);
}
void cmComputeLinkInformation::ComputeFrameworkInfo()