Merge topic 'output-CMP0022-entries'

0b3b336 CMP0022: Output link interface mismatch for static library warning
This commit is contained in:
Brad King 2013-10-23 08:20:14 -04:00 committed by CMake Topic Stage
commit d67286ff9b
2 changed files with 35 additions and 1 deletions

View File

@ -5311,6 +5311,25 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
{ {
std::string oldLibraries;
std::string newLibraries;
const char *sep = "";
for(std::vector<std::string>::const_iterator it
= impl->Libraries.begin(); it != impl->Libraries.end(); ++it)
{
oldLibraries += sep;
oldLibraries += *it;
sep = ";";
}
sep = "";
for(std::vector<std::string>::const_iterator it
= ifaceLibs.begin(); it != ifaceLibs.end(); ++it)
{
newLibraries += sep;
newLibraries += *it;
sep = ";";
}
cmOStringStream w; cmOStringStream w;
w << (this->Makefile->GetPolicies() w << (this->Makefile->GetPolicies()
->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
@ -5318,7 +5337,13 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
"INTERFACE_LINK_LIBRARIES property. This should be preferred " "INTERFACE_LINK_LIBRARIES property. This should be preferred "
"as the source of the link interface for this library. " "as the source of the link interface for this library. "
"Ignoring the property and using the link implementation " "Ignoring the property and using the link implementation "
"as the link interface instead."; "as the link interface instead."
"\n"
"INTERFACE_LINK_LIBRARIES:\n "
<< newLibraries
<< "\n"
<< "Link implementation:\n "
<< oldLibraries << "\n";
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
} }
// Fall through // Fall through

View File

@ -7,4 +7,13 @@ CMake Warning \(dev\) in CMakeLists.txt:
should be preferred as the source of the link interface for this library. should be preferred as the source of the link interface for this library.
Ignoring the property and using the link implementation as the link Ignoring the property and using the link implementation as the link
interface instead. interface instead.
INTERFACE_LINK_LIBRARIES:
foo
Link implementation:
bat
This warning is for project developers. Use -Wno-dev to suppress it.$ This warning is for project developers. Use -Wno-dev to suppress it.$