ENH: Added cmSystemTools::EnableMSVCDebugHook() to prevent error dialogs when CMake is invoked by Dart.

This commit is contained in:
Brad King
2002-12-11 11:49:08 -05:00
parent e9e3855c65
commit d6f98c2a82
7 changed files with 34 additions and 0 deletions
+23
View File
@@ -2427,3 +2427,26 @@ void cmSystemTools::SplitProgramFromArgs(const char* path,
program = "";
args = "";
}
#if defined(_MSC_VER) && defined(_DEBUG)
# include <crtdbg.h>
# include <stdio.h>
# include <stdlib.h>
static int cmSystemToolsDebugReport(int, char* message, int*)
{
if(getenv("DART_TEST_FROM_DART"))
{
fprintf(stderr, message);
exit(1);
}
return 0;
}
void cmSystemTools::EnableMSVCDebugHook()
{
_CrtSetReportHook(cmSystemToolsDebugReport);
}
#else
void cmSystemTools::EnableMSVCDebugHook()
{
}
#endif