From 77b581c2f004a36b2b62cc7c678abf51f92c76b5 Mon Sep 17 00:00:00 2001 From: Nils Gladitz Date: Fri, 28 Mar 2014 21:38:10 +0100 Subject: Policies: omit warnings about unset policies when they are actually set to NEW --- Source/cmAddLibraryCommand.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Source/cmAddLibraryCommand.cxx') diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 009b1caa43..e62a40e9d9 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -214,11 +214,17 @@ bool cmAddLibraryCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; + cmOStringStream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { case cmPolicies::WARN: - issueMessage = type != cmTarget::INTERFACE_LIBRARY; + if(type != cmTarget::INTERFACE_LIBRARY) + { + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n"; + issueMessage = true; + } case cmPolicies::OLD: break; case cmPolicies::NEW: @@ -229,9 +235,6 @@ bool cmAddLibraryCommand } if (issueMessage) { - cmOStringStream e; - e << (this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n"; e << "The target name \"" << libName << "\" is reserved or not valid for certain " "CMake features, such as generator expressions, and may result " -- cgit v1.2.1