diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-03 20:18:58 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-06 18:40:36 (GMT) |
commit | 52ca45e4855e028fc6d3eeda0584ca0f26dd3880 (patch) | |
tree | 9baaa4a909bf0a7d112a626c652b1463f6cc1ebe /Source | |
parent | 41da256b0286216ce73e91761f5d20c5b24ba311 (diff) | |
download | CMake-52ca45e4855e028fc6d3eeda0584ca0f26dd3880.zip CMake-52ca45e4855e028fc6d3eeda0584ca0f26dd3880.tar.gz CMake-52ca45e4855e028fc6d3eeda0584ca0f26dd3880.tar.bz2 |
cmComputeLinkInformation: combine string literals where possible
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 1e4bbbf..3a51710 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1401,8 +1401,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo() reg += p; reg += "|"; } - reg += ")"; - reg += "([^/:]*)"; + reg += ")([^/:]*)"; // Create a regex to match any library name. std::string reg_any = cmStrCat(reg, libext); @@ -1860,8 +1859,8 @@ void cmComputeLinkInformation::AddFrameworkItem(LinkEntry const& entry) : cmGlobalGenerator::FrameworkFormat::Extended); if (!fwDescriptor) { std::ostringstream e; - e << "Could not parse framework path \"" << item << "\" " - << "linked by target " << this->Target->GetName() << "."; + e << "Could not parse framework path \"" << item << "\" linked by target " + << this->Target->GetName() << "."; cmSystemTools::Error(e.str()); return; } @@ -1995,9 +1994,9 @@ void cmComputeLinkInformation::HandleBadFullItem(LinkEntry const& entry, std::ostringstream w; /* clang-format off */ w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0008) << "\n" - << "Target \"" << this->Target->GetName() << "\" links to item\n" - << " " << item << "\n" - << "which is a full-path but not a valid library file name."; + "Target \"" << this->Target->GetName() << "\" links to item\n" + " " << item << "\n" + "which is a full-path but not a valid library file name."; /* clang-format on */ this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(), this->Target->GetBacktrace()); @@ -2015,9 +2014,9 @@ void cmComputeLinkInformation::HandleBadFullItem(LinkEntry const& entry, std::ostringstream e; /* clang-format off */ e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0008) << "\n" - << "Target \"" << this->Target->GetName() << "\" links to item\n" - << " " << item << "\n" - << "which is a full-path but not a valid library file name."; + "Target \"" << this->Target->GetName() << "\" links to item\n" + " " << item << "\n" + "which is a full-path but not a valid library file name."; /* clang-format on */ this->CMakeInstance->IssueMessage(MessageType::FATAL_ERROR, e.str(), this->Target->GetBacktrace()); @@ -2076,18 +2075,17 @@ void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os) // Tell the user what to do. /* clang-format off */ os << "Policy CMP0003 should be set before this line. " - << "Add code such as\n" - << " if(COMMAND cmake_policy)\n" - << " cmake_policy(SET CMP0003 NEW)\n" - << " endif(COMMAND cmake_policy)\n" - << "as early as possible but after the most recent call to " - << "cmake_minimum_required or cmake_policy(VERSION). "; + "Add code such as\n" + " if(COMMAND cmake_policy)\n" + " cmake_policy(SET CMP0003 NEW)\n" + " endif(COMMAND cmake_policy)\n" + "as early as possible but after the most recent call to " + "cmake_minimum_required or cmake_policy(VERSION). "; /* clang-format on */ // List the items that might need the old-style paths. os << "This warning appears because target \"" << this->Target->GetName() - << "\" " - << "links to some libraries for which the linker must search:\n"; + << "\" links to some libraries for which the linker must search:\n"; { // Format the list of unknown items to be as short as possible while // still fitting in the allowed width (a true solution would be the @@ -2125,11 +2123,11 @@ void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os) // Explain. os << "CMake is adding directories in the second list to the linker " - << "search path in case they are needed to find libraries from the " - << "first list (for backwards compatibility with CMake 2.4). " - << "Set policy CMP0003 to OLD or NEW to enable or disable this " - << "behavior explicitly. " - << "Run \"cmake --help-policy CMP0003\" for more information."; + "search path in case they are needed to find libraries from the " + "first list (for backwards compatibility with CMake 2.4). " + "Set policy CMP0003 to OLD or NEW to enable or disable this " + "behavior explicitly. " + "Run \"cmake --help-policy CMP0003\" for more information."; } void cmComputeLinkInformation::LoadImplicitLinkInfo() |