diff options
author | Brad King <brad.king@kitware.com> | 2018-01-29 13:05:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-29 13:05:27 (GMT) |
commit | 92cd3d06772ada13935790d66927ab4663c7d628 (patch) | |
tree | 2550a2ad9003b47f9029c186aeabdfd6521bc615 /Source/CTest/cmCTestBuildAndTestHandler.cxx | |
parent | 18153217e27d2cf560d874313557ec9fa2bcffdb (diff) | |
parent | c85bb007df37aad9f20355cdf4d7ca9af562cb20 (diff) | |
download | CMake-92cd3d06772ada13935790d66927ab4663c7d628.zip CMake-92cd3d06772ada13935790d66927ab4663c7d628.tar.gz CMake-92cd3d06772ada13935790d66927ab4663c7d628.tar.bz2 |
Merge topic 'reduce-temporaries'
c85bb007 Reduce allocation of temporary values on heap.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1698
Diffstat (limited to 'Source/CTest/cmCTestBuildAndTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 81089ca..5ccab26 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -51,19 +51,13 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, args.push_back(cmSystemTools::GetCMakeCommand()); args.push_back(this->SourceDir); if (!this->BuildGenerator.empty()) { - std::string generator = "-G"; - generator += this->BuildGenerator; - args.push_back(generator); + args.push_back("-G" + this->BuildGenerator); } if (!this->BuildGeneratorPlatform.empty()) { - std::string platform = "-A"; - platform += this->BuildGeneratorPlatform; - args.push_back(platform); + args.push_back("-A" + this->BuildGeneratorPlatform); } if (!this->BuildGeneratorToolset.empty()) { - std::string toolset = "-T"; - toolset += this->BuildGeneratorToolset; - args.push_back(toolset); + args.push_back("-T" + this->BuildGeneratorToolset); } const char* config = nullptr; @@ -77,8 +71,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, #endif if (config) { - std::string btype = "-DCMAKE_BUILD_TYPE:STRING=" + std::string(config); - args.push_back(btype); + args.push_back("-DCMAKE_BUILD_TYPE:STRING=" + std::string(config)); } for (std::string const& opt : this->BuildOptions) { |