[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdenlive/Applications/18.08] /: Windows crash reports
From:       Vincent Pinon <null () kde ! org>
Date:       2018-09-28 20:32:47
Message-ID: E1g5zRP-0004L4-BK () code ! kde ! org
[Download RAW message or body]

Git commit 51d34999ee1f6d90c0aaa5dd96f1e3f5c5b893ab by Vincent Pinon.
Committed on 28/09/2018 at 20:20.
Pushed by vpinon into branch 'Applications/18.08'.

Windows crash reports

M  +3    -0    CMakeLists.txt
A  +25   -0    cmake/modules/FindDrMinGW.cmake
M  +5    -2    src/CMakeLists.txt
M  +8    -3    src/main.cpp

https://commits.kde.org/kdenlive/51d34999ee1f6d90c0aaa5dd96f1e3f5c5b893ab

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 458b429d2..573249018 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,6 +92,9 @@ endif()
 find_package(KF5 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config \
                ConfigWidgets 
                             DBusAddons KIO WidgetsAddons NotifyConfig NewStuff \
XmlGui Notifications GuiAddons TextWidgets IconThemes  OPTIONAL_COMPONENTS DocTools \
FileMetaData Crash Purpose) +if(WIN32)
+    find_package(DrMinGW)
+endif(WIN32)
 
 if (KF5FileMetaData_FOUND)
   message(STATUS "Found KF5 FileMetadata to extract file metadata")
diff --git a/cmake/modules/FindDrMinGW.cmake b/cmake/modules/FindDrMinGW.cmake
new file mode 100644
index 000000000..f734dd33b
--- /dev/null
+++ b/cmake/modules/FindDrMinGW.cmake
@@ -0,0 +1,25 @@
+# cmake macro to find DrMinGW Windows crash handler
+#
+# copyright (c) 2018, Vincent Pinon <vpinon@kde.org>
+#
+# once done this will define:
+#
+#  DRMINGW_FOUND - system has DrMinGW
+#  DRMINGW_INCLUDE_DIR - the DrMinGW include directory
+#  DRMINGW_LIBRARY - the libraries needed to use DrMinGW
+#
+# redistribution and use is allowed according to the terms of the bsd license.
+
+if (DRMINGW_INCLUDE_DIR AND DRMINGW_LIBRARY)
+    # already in cache, be silent
+    set (DRMINGW_FIND_QUIETLY true)
+endif (DRMINGW_INCLUDE_DIR AND DRMINGW_LIBRARY)
+
+find_path (DRMINGW_INCLUDE_DIR exchndl.h)
+find_library (DRMINGW_LIBRARY exchndl)
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (DrMinGW DEFAULT_MSG DRMINGW_INCLUDE_DIR \
DRMINGW_LIBRARY) +
+mark_as_advanced(DRMINGW_INCLUDE_DIR DRMINGW_LIBRARY)
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c985b996c..58394a280 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -294,10 +294,13 @@ if (KF5_FILEMETADATA)
     target_link_libraries(kdenlive KF5::FileMetaData)
 endif()
 
-if (KF5Crash_FOUND)
+if (DRMINGW_FOUND)
+    add_definitions(-DUSE_DRMINGW)
+    target_link_libraries(kdenlive ${DRMINGW_LIBRARY})
+elseif (KF5Crash_FOUND)
     add_definitions(-DKF5_USE_CRASH)
     target_link_libraries(kdenlive KF5::Crash)
-endif()
+endif(DRMINGW_FOUND)
 
 target_link_libraries(kdenlive Qt5::Script Qt5::Widgets Qt5::Concurrent Qt5::Qml \
Qt5::Quick)  
diff --git a/src/main.cpp b/src/main.cpp
index 82b2731a7..a9213028a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -26,9 +26,12 @@
 #include "kxmlgui_version.h"
 
 #include <KAboutData>
-#ifdef KF5_USE_CRASH
-#include <KCrash>
+#ifdef USE_DRMINGW
+#   include <exchndl.h>
+#elif defined(KF5_USE_CRASH)
+#   include <KCrash>
 #endif
+
 #include <KIconLoader>
 #include <KSharedConfig>
 #include <KConfigGroup>
@@ -147,7 +150,9 @@ int main(int argc, char *argv[])
     parser.process(app);
     aboutData.processCommandLine(&parser);
 
-#ifdef KF5_USE_CRASH
+#ifdef USE_DRMINGW
+    ExcHndlInit();
+#elif defined(KF5_USE_CRASH)
     KCrash::initialize();
 #endif
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic