|
|
@@ -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
|