summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@nokia.com>2010-08-04 12:15:35 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-09-20 14:56:14 (GMT)
commit1a99cdbb36334e17c34b38dd5df1bdd70167b42a (patch)
tree1c01d3c35f9f12a23cf63812a27c54a90d0ff4cb /mkspecs/features
parent1c379003d168a3232d36fb0690bbc546ec158a06 (diff)
downloadQt-1a99cdbb36334e17c34b38dd5df1bdd70167b42a.zip
Qt-1a99cdbb36334e17c34b38dd5df1bdd70167b42a.tar.gz
Qt-1a99cdbb36334e17c34b38dd5df1bdd70167b42a.tar.bz2
Add breakpad support
Breakpad is a portable crash handler. It sends the raw crash information to a server for analysis. This analysis needs debug information. Consequently, we compile with debug info even in release mode if qt-breakpad integration is requested (via an environment variable). Reviewed-by: ossi
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/default_post.prf88
1 files changed, 88 insertions, 0 deletions
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index d844385..59a5e86 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -1,3 +1,15 @@
+QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
+!isEmpty(QT_BREAKPAD_ROOT_PATH): \ # quick test first whether requested ...
+ !staticlib:!static:CONFIG(release, debug|release):contains(TEMPLATE, .*(app|lib)): \ # is it applicable?
+ !contains(TARGET, .*phony_target.*): \ # monster hack, you don't really see this here, right? ;)
+ system($$QT_BREAKPAD_ROOT_PATH/qtbreakpadsymbols --breakpad-exists) { # do we really have it?
+ CONFIG += breakpad
+ CONFIG -= no_debug_info separate_debug_info
+ QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
+ QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
+ QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
+}
+
CONFIG(debug, debug|release):load(debug)
else:load(release)
debug_and_release:load(debug_and_release)
@@ -6,6 +18,82 @@ incredibuild_xge {
CONFIG = incredibuild_xge $$CONFIG
}
+breakpad {
+ !contains(DESTDIR, (/|.:[/\\\\]).*):TARGET_BASEPATH = $${OUT_PWD}/
+ !isEmpty(DESTDIR):TARGET_BASEPATH = $${TARGET_BASEPATH}$${DESTDIR}/
+
+ win32 {
+ TARGET_BASEPATH ~= s,/,\\,
+ contains(TEMPLATE, .*lib) {
+ isEmpty(TARGET_VERSION_EXT):!isEmpty(VERSION) {
+ TARGET_VERSION_EXT = $$section(VERSION, ., 0, 0)
+ isEqual(TARGET_VERSION_EXT, 0):unset(TARGET_VERSION_EXT)
+ }
+ TARGET_EXT = .dll
+ } else {
+ TARGET_EXT = .exe
+ }
+
+ DEBUGFILENAME = $${TARGET_BASEPATH}$${TARGET}$${TARGET_VERSION_EXT}$${TARGET_EXT}
+ PDBFILENAME = $${TARGET_BASEPATH}$${TARGET}$${TARGET_VERSION_EXT}.pdb
+ DEBUGFILENAME ~= s,/,\\,
+ PDBFILENAME ~= s,/,\\,
+ QMAKE_CLEAN += $$PDBFILENAME # for the debug case it is hardcoded in qmake
+ } else {
+ contains(TEMPLATE, .*lib):LIBPREFIX = lib
+
+ macx {
+ equals(TEMPLATE, lib) {
+ lib_bundle {
+ TARGET_FILENAME = $${TARGET_BASEPATH}$${TARGET}.framework/$${TARGET}
+ } else {
+ TARGET_FILENAME = $${TARGET_BASEPATH}$${LIBPREFIX}$${TARGET}
+ !plugin {
+ TEMP_VERSION = $$section(VERSION, ., 0, 0)
+ isEmpty(TEMP_VERSION):TEMP_VERSION = 1
+ TARGET_FILENAME = $${TARGET_FILENAME}.$${TEMP_VERSION}
+ }
+ TARGET_FILENAME = $${TARGET_FILENAME}.$${QMAKE_EXTENSION_SHLIB}
+ }
+ } else {
+ app_bundle {
+ TARGET_FILENAME = $${TARGET_BASEPATH}$${TARGET}.app/Contents/MacOS/$${TARGET}
+ } else {
+ TARGET_FILENAME = $${TARGET_BASEPATH}$${TARGET}
+ }
+ }
+ DEBUGFILENAME = $$TARGET_FILENAME
+ } else {
+ equals(TEMPLATE, lib) {
+ plugin {
+ TARGET_FILENAME = $${TARGET_BASEPATH}$${LIBPREFIX}$${TARGET}.so
+ } else {
+ TEMP_VERSION = $$VERSION
+ isEmpty(TEMP_VERSION):TEMP_VERSION = 1.0.0
+ TARGET_FILENAME = $${TARGET_BASEPATH}$${LIBPREFIX}$${TARGET}.so.$${TEMP_VERSION}
+ }
+ } else {
+ TARGET_BASEPATH = $${TARGET_BASEPATH}$${TARGET}
+ }
+ DEBUGFILENAME = $$TARGET_BASEPATH
+ }
+ }
+
+ PROJECTPATH = $$OUT_PWD
+ win32:PROJECTPATH ~= s,/,\\,
+
+ !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)
+ QMAKE_POST_LINK += $$quote($${QT_BREAKPAD_ROOT_PATH}$${DIR_SEPARATOR}qtbreakpadsymbols \"$$DEBUGFILENAME\" \"$$PROJECTPATH\")
+ !isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$quote($$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$QMAKE_STRIP \"$$DEBUGFILENAME\")
+
+ unset(TARGET_BASEPATH)
+ unset(TARGET_FILENAME)
+ unset(SYMBOLFILENAME)
+ unset(TARGET_EXT)
+ unset(TARGET_VERSION_EXT)
+ unset(TEMP_VERSION)
+}
+
QMAKE_INCDIR += $$QMAKE_INCDIR_POST
QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST