summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGhsMultiGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-23 14:03:33 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-08-23 14:03:57 (GMT)
commit7f2bb732fc2b684f5b36c522d75ae50faaabab45 (patch)
treecca3f50e8efed9a8997d95d1e9f3b26948500a3e /Source/cmLocalGhsMultiGenerator.cxx
parent68126f5a02b7d21b0d632b9e2c63687b71b3f5fa (diff)
parent9b334397f55b70689ff1d8f7d6767a34834e85b6 (diff)
downloadCMake-7f2bb732fc2b684f5b36c522d75ae50faaabab45.zip
CMake-7f2bb732fc2b684f5b36c522d75ae50faaabab45.tar.gz
CMake-7f2bb732fc2b684f5b36c522d75ae50faaabab45.tar.bz2
Merge topic 'source_sweep_cmStrCat'
9b334397f5 Source sweep: Use cmStrCat for string concatenation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Rolf Eike Beer <eike@sf-mail.de> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !3699
Diffstat (limited to 'Source/cmLocalGhsMultiGenerator.cxx')
-rw-r--r--Source/cmLocalGhsMultiGenerator.cxx25
1 files changed, 11 insertions, 14 deletions
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index bf25f98..b00dda1 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -7,6 +7,7 @@
#include "cmGlobalGenerator.h"
#include "cmSourceFile.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include <algorithm>
@@ -23,9 +24,7 @@ cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator() = default;
std::string cmLocalGhsMultiGenerator::GetTargetDirectory(
cmGeneratorTarget const* target) const
{
- std::string dir;
- dir += target->GetName();
- dir += ".dir";
+ std::string dir = cmStrCat(target->GetName(), ".dir");
return dir;
}
@@ -63,11 +62,8 @@ void cmLocalGhsMultiGenerator::ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,
cmGeneratorTarget const* gt)
{
- std::string dir_max;
- dir_max += this->GetCurrentBinaryDirectory();
- dir_max += "/";
- dir_max += this->GetTargetDirectory(gt);
- dir_max += "/";
+ std::string dir_max = cmStrCat(this->GetCurrentBinaryDirectory(), '/',
+ this->GetTargetDirectory(gt), '/');
// Count the number of object files with each name. Note that
// filesystem may not be case sensitive.
@@ -75,9 +71,10 @@ void cmLocalGhsMultiGenerator::ComputeObjectFilenames(
for (auto const& si : mapping) {
cmSourceFile const* sf = si.first;
- std::string objectNameLower = cmSystemTools::LowerCase(
- cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
- objectNameLower += this->GlobalGenerator->GetLanguageOutputExtension(*sf);
+ std::string objectNameLower = cmStrCat(
+ cmSystemTools::LowerCase(
+ cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath())),
+ this->GlobalGenerator->GetLanguageOutputExtension(*sf));
counts[objectNameLower] += 1;
}
@@ -85,9 +82,9 @@ void cmLocalGhsMultiGenerator::ComputeObjectFilenames(
// object name computation.
for (auto& si : mapping) {
cmSourceFile const* sf = si.first;
- std::string objectName =
- cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
- objectName += this->GlobalGenerator->GetLanguageOutputExtension(*sf);
+ std::string objectName = cmStrCat(
+ cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()),
+ this->GlobalGenerator->GetLanguageOutputExtension(*sf));
if (counts[cmSystemTools::LowerCase(objectName)] > 1) {
const_cast<cmGeneratorTarget*>(gt)->AddExplicitObjectName(sf);