# ninja: build stopped: subcommand failed.

**URL:** https://discourse.cmake.org/t/ninja-build-stopped-subcommand-failed/15713
**Category:** Usage
**Created:** [June 15, 2026, 8:51am UTC](https://discourse.cmake.org/t/ninja-build-stopped-subcommand-failed/15713 "2026-06-15T08:51:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![perdrix](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@perdrix](https://discourse.cmake.org/u/perdrix)
#### Post date: [June 15, 2026, 8:51am UTC](https://discourse.cmake.org/t/ninja-build-stopped-subcommand-failed/15713/1 "2026-06-15T08:51:59Z")

</div>

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

```auto
  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

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [June 15, 2026, 9:23pm UTC](https://discourse.cmake.org/t/ninja-build-stopped-subcommand-failed/15713/2 "2026-06-15T21:23:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![perdrix](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@perdrix](https://discourse.cmake.org/u/perdrix)
#### Post date: [June 16, 2026, 9:53am UTC](https://discourse.cmake.org/t/ninja-build-stopped-subcommand-failed/15713/3 "2026-06-16T09:53:04Z")

</div>

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