diff options
author | lumberyard-employee-dm <mcgarrah@amazon.com> | 2020-06-11 16:51:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-12 15:40:23 (GMT) |
commit | 87c860ebadabb669a570119186aabbd99cad1e5e (patch) | |
tree | 846f0fd40d2c9b6ab03df5756656637aa998c033 /Source/cmGlobalGenerator.cxx | |
parent | 7925279c20754113227202848545804cde30a3b6 (diff) | |
download | CMake-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
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 5 |
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 += " && "; |