diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-05-16 14:50:03 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-05-16 16:15:31 (GMT) |
commit | 465ab8d872aeabfffab0c1dd0510bad1bb49fa92 (patch) | |
tree | 181fc2553e5a556e07612fc2cc0b20ae27949dc3 /Source/cmGlobalGenerator.cxx | |
parent | 81d45dabc4534f15b8c61935060cd4d10f258f15 (diff) | |
download | CMake-465ab8d872aeabfffab0c1dd0510bad1bb49fa92.zip CMake-465ab8d872aeabfffab0c1dd0510bad1bb49fa92.tar.gz CMake-465ab8d872aeabfffab0c1dd0510bad1bb49fa92.tar.bz2 |
cmGlobalGenerator: use `cmStrCat` in `::Build`
Also replace some single-char strings with character literals.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 040f500..f8f9442 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2096,16 +2096,13 @@ int cmGlobalGenerator::Build( * Run an executable command and put the stdout in output. */ cmWorkingDirectory workdir(bindir); - output += "Change Dir: "; - output += bindir; - output += "\n"; + output += cmStrCat("Change Dir: ", bindir, '\n'); if (workdir.Failed()) { cmSystemTools::SetRunCommandHideConsole(hideconsole); std::string err = cmStrCat("Failed to change directory: ", std::strerror(workdir.GetLastResult())); cmSystemTools::Error(err); - output += err; - output += "\n"; + output += cmStrCat(err, '\n'); return 1; } std::string realConfig = config; @@ -2134,9 +2131,8 @@ int cmGlobalGenerator::Build( this->GenerateBuildCommand(makeCommandCSTR, projectName, bindir, { "clean" }, realConfig, jobs, verbose, buildOptions); - output += "\nRun Clean Command:"; - output += cleanCommand.front().Printable(); - output += "\n"; + output += + cmStrCat("\nRun Clean Command:", cleanCommand.front().Printable(), '\n'); if (cleanCommand.size() != 1) { this->GetCMakeInstance()->IssueMessage(MessageType::INTERNAL_ERROR, "The generator did not produce " @@ -2149,8 +2145,8 @@ int cmGlobalGenerator::Build( nullptr, outputflag, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error("Generator: execution of make clean failed."); - output += *outputPtr; - output += "\nGenerator: execution of make clean failed.\n"; + output += + cmStrCat(*outputPtr, "\nGenerator: execution of make clean failed.\n"); return 1; } @@ -2177,9 +2173,10 @@ int cmGlobalGenerator::Build( cmSystemTools::Error( "Generator: execution of make failed. Make command was: " + makeCommandStr); - output += *outputPtr; - output += "\nGenerator: execution of make failed. Make command was: " + - makeCommandStr + "\n"; + output += + cmStrCat(*outputPtr, + "\nGenerator: execution of make failed. Make command was: ", + makeCommandStr, '\n'); return 1; } |