summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-04-01 15:06:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-04-01 15:06:17 (GMT)
commitf70b2253f65fd01223859c7391cabd25fce184bf (patch)
tree4c3cdf1b623ee673e19b93503d30edb1bd59c03f /Source/cmTargetLinkLibrariesCommand.cxx
parent242e13bfe622d80ca329119ae4027d739d7fa90f (diff)
parent77b581c2f004a36b2b62cc7c678abf51f92c76b5 (diff)
downloadCMake-f70b2253f65fd01223859c7391cabd25fce184bf.zip
CMake-f70b2253f65fd01223859c7391cabd25fce184bf.tar.gz
CMake-f70b2253f65fd01223859c7391cabd25fce184bf.tar.bz2
Merge topic 'fix_policy_diagnostics'
77b581c2 Policies: omit warnings about unset policies when they are actually set to NEW
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 115a988..1c2e625 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -103,11 +103,14 @@ bool cmTargetLinkLibrariesCommand
if (this->Target->GetType() == cmTarget::UTILITY)
{
+ cmOStringStream e;
const char *modal = 0;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0039))
{
case cmPolicies::WARN:
+ e << this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0039) << "\n";
modal = "should";
case cmPolicies::OLD:
break;
@@ -119,9 +122,7 @@ bool cmTargetLinkLibrariesCommand
}
if (modal)
{
- cmOStringStream e;
- e << this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0039) << "\n"
+ e <<
"Utility target \"" << this->Target->GetName() << "\" " << modal
<< " not be used as the target of a target_link_libraries call.";
this->Makefile->IssueMessage(messageType, e.str());
@@ -373,11 +374,14 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
? cmTarget::KeywordTLLSignature : cmTarget::PlainTLLSignature;
if (!this->Target->PushTLLCommandTrace(sig))
{
+ cmOStringStream e;
const char *modal = 0;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0023))
{
case cmPolicies::WARN:
+ e << this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0023) << "\n";
modal = "should";
case cmPolicies::OLD:
break;
@@ -390,14 +394,12 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if(modal)
{
- cmOStringStream e;
// If the sig is a keyword form and there is a conflict, the existing
// form must be the plain form.
const char *existingSig
= (sig == cmTarget::KeywordTLLSignature ? "plain"
: "keyword");
- e << this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0023) << "\n"
+ e <<
"The " << existingSig << " signature for target_link_libraries "
"has already been used with the target \""
<< this->Target->GetName() << "\". All uses of "