default
default

Reputation: 2757

How to get cmake --build to stop on error

I'm running cmake --build, but when there are errors, it keeps going for quite a while. I'd prefer if it would stop at the first error. Is there a way to do that with the cmake build option?

Here is my command:

cmake -G "Visual Studio 15 2017" ../
cmake --build . --config Release

Upvotes: 4

Views: 2906

Answers (1)

Th. Thielemann
Th. Thielemann

Reputation: 2825

I can answer for make only, but do not know whether it fits for Visual Studio 17 also.

The make command supports parallel builds. Every build process runs as far as possible. Either to the end, to next dependency or error.

To stop the workflow at first error just run only on process.

  • Errors are easier to find
  • Increases time to wait in most of the cases

See cmake --build options for more details (at least the -j option): cmake - Build a Project

Upvotes: 1

Related Questions