ninja: build stopped: subcommand failed.

I’m running a CMake build and got part way through and was then presented with the cryptic message in the subject line:

  ninja: build stopped: subcommand failed.

The file ninja.log in my build directory doesn’t give me any indication of problems. So, where do I look to find out what’s gone wrong please?

Thanks, David

Is this reproducible? If not, I don’t think there’s much you can do to work out after-the-fact what happened. If it is reproducible though, then you can do things like force ninja to build non-parallel and then the last task before ninja stops will be the one that is failing. A command like ninja --verbose -j1 would get you there.

If you can’t reproduce it, my guess would be a failed custom command that doesn’t report anything if it fails.

I found the problem by using msbuild to build the project. Once I fixed it the CMake build worked again.