From 83270e09c1ec17f610df0645810eddffa0b8ccdf Mon Sep 17 00:00:00 2001 From: Bernd Wachter Date: Thu, 28 Jan 2010 12:49:16 +0100 Subject: Add support for MingW crash handler; define DEBUG for debug builds --- src/CMakeLists.txt | 8 ++++++++ src/main.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 82befb21..cc0a0c3b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,6 +29,14 @@ IF (ENABLE_NLS) SET(FLAGS "${FLAGS} -DENABLE_NLS=1") ENDIF() +IF (CMAKE_BUILD_TYPE) + STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) + IF((CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) OR + (CMAKE_BUILD_TYPE_TOLOWER MATCHES relwithdebinfo)) + SET(FLAGS "${FLAGS} -DDEBUG") + ENDIF() +ENDIF() + IF (WIN32) SET(EXTRA_LIBRARIES ws2_32 winmm) FIND_PACKAGE(LibIntl REQUIRED) diff --git a/src/main.cpp b/src/main.cpp index af1057a7..6454b123 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,6 +722,10 @@ static void initXML() /** Main */ int main(int argc, char *argv[]) { +#if defined(DEBUG) && defined(WIN32) + // load mingw crash handler. Won't fail if dll is not present. + LoadLibrary("exchndl.dll"); +#endif // Parse command line options Options options; parseOptions(argc, argv, options); -- cgit v1.2.3-70-g09d2