Browse Source

Merge pull request #478 from sledgehammer999/win_backtrace

Move backtrace support to windows specific pri files and other minor improvements. v2
adaptive-webui-19844
sledgehammer999 12 years ago
parent
commit
4e0dc5d51a
  1. 6
      src/main.cpp
  2. 35
      src/src.pro
  3. 13
      winconf-mingw.pri
  4. 13
      winconf-msvc.pri
  5. 10
      winconf.pri

6
src/main.cpp

@ -65,7 +65,7 @@ Q_IMPORT_PLUGIN(qico) @@ -65,7 +65,7 @@ Q_IMPORT_PLUGIN(qico)
#include "stacktrace.h"
#endif
#if defined(Q_OS_WIN) && defined(STACKTRACE_WIN)
#ifdef STACKTRACE_WIN
#include <signal.h>
#include "stacktrace_win.h"
#include "stacktrace_win_dlg.h"
@ -133,7 +133,7 @@ public: @@ -133,7 +133,7 @@ public:
#include "main.moc"
#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_WIN)
#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(STACKTRACE_WIN)
void sigintHandler(int) {
signal(SIGINT, 0);
qDebug("Catching SIGINT, exiting cleanly");
@ -333,7 +333,7 @@ int main(int argc, char *argv[]) { @@ -333,7 +333,7 @@ int main(int argc, char *argv[]) {
#ifndef DISABLE_GUI
app.setQuitOnLastWindowClosed(false);
#endif
#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_WIN)
#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(STACKTRACE_WIN)
signal(SIGABRT, sigabrtHandler);
signal(SIGTERM, sigtermHandler);
signal(SIGINT, sigintHandler);

35
src/src.pro

@ -239,38 +239,3 @@ TRANSLATIONS = $$LANG_PATH/qbittorrent_fr.ts \ @@ -239,38 +239,3 @@ TRANSLATIONS = $$LANG_PATH/qbittorrent_fr.ts \
$$LANG_PATH/qbittorrent_be.ts \
$$LANG_PATH/qbittorrent_eu.ts \
$$LANG_PATH/qbittorrent_he.ts
# Windows Stacktrace support
strace_win:win32:{
contains(QMAKE_HOST.arch, x86):{
# i686 arch requires frame pointer preservation
win32-g++:{
QMAKE_CXXFLAGS_RELEASE += -fno-omit-frame-pointer
QMAKE_CXXFLAGS_DEBUG += -fno-omit-frame-pointer
}
win32-msvc*:{
QMAKE_CXXFLAGS_RELEASE += -Oy-
QMAKE_CXXFLAGS_DEBUG += -Oy-
}
}
# Generate debug info in release builds
release:{
#win32-g++:{
# QMAKE_CXXFLAGS_RELEASE += -g
# QMAKE_LFLAGS_RELEASE -= -Wl,-s
#}
win32-msvc*:{
QMAKE_CXXFLAGS_RELEASE += -Zi
QMAKE_LFLAGS += "/DEBUG"
}
}
DEFINES += STACKTRACE_WIN
win32-msvc*:LIBS += dbghelp.lib
win32-g++:LIBS += libdbghelp
FORMS += stacktrace_win_dlg.ui
HEADERS += stacktrace_win.h \
stacktrace_win_dlg.h
}

13
winconf-mingw.pri

@ -1,3 +1,16 @@ @@ -1,3 +1,16 @@
strace_win:{
contains(QMAKE_HOST.arch, x86):{
# i686 arch requires frame pointer preservation
QMAKE_CXXFLAGS_RELEASE += -fno-omit-frame-pointer
QMAKE_CXXFLAGS_DEBUG += -fno-omit-frame-pointer
}
release:{
#QMAKE_CXXFLAGS_RELEASE += -g
#QMAKE_LFLAGS_RELEASE -= -Wl,-s
}
LIBS += libdbghelp
}
RC_FILE = qbittorrent_mingw.rc
#You need to link with libtorrent > 0.15.5 (or svn) and you must

13
winconf-msvc.pri

@ -1,3 +1,16 @@ @@ -1,3 +1,16 @@
strace_win:{
contains(QMAKE_HOST.arch, x86):{
# i686 arch requires frame pointer preservation
QMAKE_CXXFLAGS_RELEASE += -Oy-
QMAKE_CXXFLAGS_DEBUG += -Oy-
}
release:{
QMAKE_CXXFLAGS_RELEASE += -Zi
QMAKE_LFLAGS += "/DEBUG"
}
LIBS += dbghelp.lib
}
RC_FILE = qbittorrent.rc
# Enable Wide characters

10
winconf.pri

@ -36,6 +36,16 @@ CONFIG(debug, debug|release) { @@ -36,6 +36,16 @@ CONFIG(debug, debug|release) {
DEFINES += NDEBUG
}
#Enable backtrace support
CONFIG += strace_win
strace_win:{
DEFINES += STACKTRACE_WIN
FORMS += stacktrace_win_dlg.ui
HEADERS += stacktrace_win.h \
stacktrace_win_dlg.h
}
win32-g++ {
include(winconf-mingw.pri)
}

Loading…
Cancel
Save