mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
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
This commit is contained in:
committed by
Brad King
parent
7925279c20
commit
87c860ebad
@@ -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 += " && ";
|
||||
|
||||
Reference in New Issue
Block a user