mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
cmTargetLinkLibrariesCommand: Optimize ostream::operator<< calls
This commit is contained in:
@@ -97,8 +97,8 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
|
||||
if (!target) {
|
||||
MessageType t = MessageType::FATAL_ERROR; // fail by default
|
||||
std::ostringstream e;
|
||||
e << "Cannot specify link libraries for target \"" << args[0] << "\" "
|
||||
<< "which is not built by this project.";
|
||||
e << "Cannot specify link libraries for target \"" << args[0]
|
||||
<< "\" which is not built by this project.";
|
||||
// The bad target is the only argument. Check how policy CMP0016 is set,
|
||||
// and accept, warn or fail respectively:
|
||||
if (args.size() < 2) {
|
||||
@@ -107,9 +107,9 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
|
||||
t = MessageType::AUTHOR_WARNING;
|
||||
// Print the warning.
|
||||
e << "\n"
|
||||
<< "CMake does not support this but it used to work accidentally "
|
||||
<< "and is being allowed for compatibility."
|
||||
<< "\n"
|
||||
"CMake does not support this but it used to work accidentally "
|
||||
"and is being allowed for compatibility."
|
||||
"\n"
|
||||
<< cmPolicies::GetPolicyWarning(cmPolicies::CMP0016);
|
||||
break;
|
||||
case cmPolicies::OLD: // OLD behavior does not warn.
|
||||
@@ -117,7 +117,7 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
|
||||
break;
|
||||
case cmPolicies::REQUIRED_IF_USED:
|
||||
case cmPolicies::REQUIRED_ALWAYS:
|
||||
e << "\n" << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0016);
|
||||
e << '\n' << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0016);
|
||||
break;
|
||||
case cmPolicies::NEW: // NEW behavior prints the error.
|
||||
break;
|
||||
@@ -145,7 +145,7 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
|
||||
MessageType messageType = MessageType::AUTHOR_WARNING;
|
||||
switch (mf.GetPolicyStatus(cmPolicies::CMP0039)) {
|
||||
case cmPolicies::WARN:
|
||||
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0039) << "\n";
|
||||
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0039) << '\n';
|
||||
modal = "should";
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
@@ -456,7 +456,7 @@ bool TLL::HandleLibrary(ProcessingState currentProcessingState,
|
||||
MessageType messageType = MessageType::AUTHOR_WARNING;
|
||||
switch (this->Makefile.GetPolicyStatus(cmPolicies::CMP0023)) {
|
||||
case cmPolicies::WARN:
|
||||
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0023) << "\n";
|
||||
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0023) << '\n';
|
||||
modal = "should";
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
|
||||
Reference in New Issue
Block a user