diff options
author | Brad King <brad.king@kitware.com> | 2024-12-10 16:20:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-12-10 16:36:29 (GMT) |
commit | b7e6c418e3d7de531f6d2b5e0de154d955dc98c8 (patch) | |
tree | 5280fe41e751367cf2f1c8e67ff13ea4b50853d9 | |
parent | c5ad3f97924b5c4f73453061c2971286a36c1072 (diff) | |
download | CMake-b7e6c418e3d7de531f6d2b5e0de154d955dc98c8.zip CMake-b7e6c418e3d7de531f6d2b5e0de154d955dc98c8.tar.gz CMake-b7e6c418e3d7de531f6d2b5e0de154d955dc98c8.tar.bz2 |
cmLocalUnixMakefileGenerator3: Simplify progress command generation
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4a776b4..d5d86b6 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -6,7 +6,6 @@ #include <cassert> #include <cstdio> #include <functional> -#include <sstream> #include <utility> #include <cm/memory> @@ -1733,33 +1732,24 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( depends.emplace_back("cmake_check_build_system"); } - std::string progressDir = - cmStrCat(this->GetBinaryDirectory(), "/CMakeFiles"); - { - std::ostringstream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; - progCmd << this->ConvertToOutputFormat(progressDir, - cmOutputConverter::SHELL); - - std::string progressFile = "/CMakeFiles/progress.marks"; - std::string progressFileNameFull = this->ConvertToFullPath(progressFile); - progCmd << " " - << this->ConvertToOutputFormat(progressFileNameFull, - cmOutputConverter::SHELL); - commands.push_back(progCmd.str()); - } + std::string const progressDir = this->ConvertToOutputFormat( + cmStrCat(this->GetBinaryDirectory(), "/CMakeFiles"), + cmOutputConverter::SHELL); + std::string const progressMarks = this->ConvertToOutputFormat( + this->ConvertToFullPath("/CMakeFiles/progress.marks"), + cmOutputConverter::SHELL); + std::string const progressStartCommand = + cmStrCat("$(CMAKE_COMMAND) -E cmake_progress_start ", progressDir, ' ', + progressMarks); + std::string const progressFinishCommand = + cmStrCat("$(CMAKE_COMMAND) -E cmake_progress_start ", progressDir, " 0"); + + commands.emplace_back(progressStartCommand); std::string mf2Dir = "CMakeFiles/Makefile2"; commands.push_back(this->GetRecursiveMakeCall(mf2Dir, recursiveTarget)); this->CreateCDCommand(commands, this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory()); - { - std::ostringstream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 - progCmd << this->ConvertToOutputFormat(progressDir, - cmOutputConverter::SHELL); - progCmd << " 0"; - commands.push_back(progCmd.str()); - } + commands.emplace_back(progressFinishCommand); this->WriteMakeRule(ruleFileStream, "The main all target", "all", depends, commands, true); |