Skip to content

cmake --build: Fix exit code when building multiple targets

The fix is to check after each iteration of invoking the target build command does not return a non-zero exit code. This ensures that when building multiple targets using the cmake --build command, when any of the targets fails to build cmake returns a non-zero exit code

Original Description: 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 (closed)
Topic-rename: cmake-build-retval

Edited by Brad King

Merge request reports