diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-03 20:12:52 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-03 20:54:50 (GMT) |
commit | 41da256b0286216ce73e91761f5d20c5b24ba311 (patch) | |
tree | 9c8dd06cf3b5bf2b18c9338b0c39d8295680bac5 /Source/cmComputeLinkInformation.cxx | |
parent | 77610c6cf0fd18586eaaf4b328936f79683afd34 (diff) | |
download | CMake-41da256b0286216ce73e91761f5d20c5b24ba311.zip CMake-41da256b0286216ce73e91761f5d20c5b24ba311.tar.gz CMake-41da256b0286216ce73e91761f5d20c5b24ba311.tar.bz2 |
cmComputeLinkInformation: use `cmStrCat` where appropriate
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ad8fb8b..1e4bbbf 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -289,28 +289,28 @@ cmComputeLinkInformation::cmComputeLinkInformation( // Get options needed to link libraries. if (cmValue flag = this->Makefile->GetDefinition( - "CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_FLAG")) { + cmStrCat("CMAKE_", this->LinkLanguage, "_LINK_LIBRARY_FLAG"))) { this->LibLinkFlag = *flag; } else { this->LibLinkFlag = this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FLAG"); } if (cmValue flag = this->Makefile->GetDefinition( - "CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_FILE_FLAG")) { + cmStrCat("CMAKE_", this->LinkLanguage, "_LINK_LIBRARY_FILE_FLAG"))) { this->LibLinkFileFlag = *flag; } else { this->LibLinkFileFlag = this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FILE_FLAG"); } if (cmValue suffix = this->Makefile->GetDefinition( - "CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_SUFFIX")) { + cmStrCat("CMAKE_", this->LinkLanguage, "_LINK_LIBRARY_SUFFIX"))) { this->LibLinkSuffix = *suffix; } else { this->LibLinkSuffix = this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_SUFFIX"); } if (cmValue flag = this->Makefile->GetDefinition( - "CMAKE_" + this->LinkLanguage + "_LINK_OBJECT_FILE_FLAG")) { + cmStrCat("CMAKE_", this->LinkLanguage, "_LINK_OBJECT_FILE_FLAG"))) { this->ObjLinkFileFlag = *flag; } else { this->ObjLinkFileFlag = @@ -325,7 +325,7 @@ cmComputeLinkInformation::cmComputeLinkInformation( : "SHARED_LIBRARY"); std::string rtVar = cmStrCat("CMAKE_", tType, "_RUNTIME_", this->LinkLanguage, "_FLAG"); - std::string rtSepVar = rtVar + "_SEP"; + std::string rtSepVar = cmStrCat(rtVar, "_SEP"); this->RuntimeFlag = this->Makefile->GetSafeDefinition(rtVar); this->RuntimeSep = this->Makefile->GetSafeDefinition(rtSepVar); this->RuntimeAlways = (this->Makefile->GetSafeDefinition( @@ -1070,8 +1070,8 @@ void cmComputeLinkInformation::AddRuntimeLinkLibrary(std::string const& lang) if (runtimeLibrary.empty()) { return; } - if (cmValue runtimeLinkOptions = this->Makefile->GetDefinition( - "CMAKE_" + lang + "_RUNTIME_LIBRARY_LINK_OPTIONS_" + runtimeLibrary)) { + if (cmValue runtimeLinkOptions = this->Makefile->GetDefinition(cmStrCat( + "CMAKE_", lang, "_RUNTIME_LIBRARY_LINK_OPTIONS_", runtimeLibrary))) { std::vector<std::string> libsVec = cmExpandedList(*runtimeLinkOptions); for (std::string const& i : libsVec) { if (!cm::contains(this->ImplicitLinkLibs, i)) { @@ -1697,7 +1697,8 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(LinkEntry const& entry) case cmPolicies::WARN: if (this->CMP0060Warn) { // Print the warning at most once for this item. - std::string const& wid = "CMP0060-WARNING-GIVEN-" + item.Value; + std::string const& wid = + cmStrCat("CMP0060-WARNING-GIVEN-", item.Value); if (!this->CMakeInstance->GetPropertyAsBool(wid)) { this->CMakeInstance->SetProperty(wid, "1"); this->CMP0060WarnItems.insert(item.Value); @@ -2144,7 +2145,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo() if (cmValue libraryArch = this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE")) { for (std::string const& i : implicitDirVec) { - this->ImplicitLinkDirs.insert(i + "/" + *libraryArch); + this->ImplicitLinkDirs.insert(cmStrCat(i, '/', *libraryArch)); } } @@ -2400,10 +2401,11 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, cmGeneratorTarget::LinkClosure const* lc = this->Target->GetLinkClosure(this->Config); for (std::string const& li : lc->Languages) { - std::string useVar = - "CMAKE_" + li + "_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH"; + std::string useVar = cmStrCat( + "CMAKE_", li, "_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH"); if (this->Makefile->IsOn(useVar)) { - std::string dirVar = "CMAKE_" + li + "_IMPLICIT_LINK_DIRECTORIES"; + std::string dirVar = + cmStrCat("CMAKE_", li, "_IMPLICIT_LINK_DIRECTORIES"); if (cmValue dirs = this->Makefile->GetDefinition(dirVar)) { cmCLI_ExpandListUnique(*dirs, runtimeDirs, emitted); } |