0

I have a solution full of C++ projects. I want to stop building and running the projects once the first project fails (aka bad exit status). In a GNU Makefile I could easily accomplish this. How do I do this in Visual Studio?

  1. Run a Program as Part of Build
  2. Get Exit Status
  3. Fail Build if Exit Status != 0

inside of Visual Studio 2010 or higher.

Matthew Hoggan
  • 7,402
  • 16
  • 75
  • 140

1 Answers1

0

Digging around MSDN and StackOverflow for a bit I came up with:

"$(TargetDir)$(TargetName).exe" if ERRORLEVEL > 0 goto EXIT

As a post build command

Community
  • 1
  • 1
Matthew Hoggan
  • 7,402
  • 16
  • 75
  • 140