summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlumberyard-employee-dm <mcgarrah@amazon.com>2020-06-11 16:51:19 (GMT)
committerBrad King <brad.king@kitware.com>2020-06-12 15:40:23 (GMT)
commit87c860ebadabb669a570119186aabbd99cad1e5e (patch)
tree846f0fd40d2c9b6ab03df5756656637aa998c033
parent7925279c20754113227202848545804cde30a3b6 (diff)
downloadCMake-87c860ebadabb669a570119186aabbd99cad1e5e.zip
CMake-87c860ebadabb669a570119186aabbd99cad1e5e.tar.gz
CMake-87c860ebadabb669a570119186aabbd99cad1e5e.tar.bz2
cmake --build: Fix exit code when building multiple targets
Updated the cmGlobalGenerator::Build method to check the return `retVal` parameter supplied to the `cmSystemTools::RunSingleCommand` to validate that each invocation of the build command returned an exit code of zero. Fixes: #20790
-rw-r--r--Source/cmGlobalGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4dc4092..1ed5e8b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1988,8 +1988,9 @@ int cmGlobalGenerator::Build(
std::string makeCommandStr;
output += "\nRun Build Command(s):";
- for (auto command = makeCommand.begin(); command != makeCommand.end();
- ++command) {
+ retVal = 0;
+ for (auto command = makeCommand.begin();
+ command != makeCommand.end() && retVal == 0; ++command) {
makeCommandStr = command->Printable();
if (command != makeCommand.end()) {
makeCommandStr += " && ";