mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05:00
ENH: Added cmSystemTools::EnableMSVCDebugHook() to prevent error dialogs when CMake is invoked by Dart.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user