summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-12-11 16:49:08 (GMT)
committerBrad King <brad.king@kitware.com>2002-12-11 16:49:08 (GMT)
commitd6f98c2a82c693f9f96bd7c515fa4946a375f3ca (patch)
tree8d5ef7199c1196cbc32e673a4b668b98561f943a /Source/cmSystemTools.cxx
parente9e3855c65e9ee32119645d6e4044ba0ee8b8a06 (diff)
downloadCMake-d6f98c2a82c693f9f96bd7c515fa4946a375f3ca.zip
CMake-d6f98c2a82c693f9f96bd7c515fa4946a375f3ca.tar.gz
CMake-d6f98c2a82c693f9f96bd7c515fa4946a375f3ca.tar.bz2
ENH: Added cmSystemTools::EnableMSVCDebugHook() to prevent error dialogs when CMake is invoked by Dart.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 40fafe2..7750349 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -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