qt5base-lts/mkspecs/features/unix/gdb_dwarf_index.prf
Oswald Buddenhagen ffa2e1d007 define have_target CONFIG flag
the check whether we are building a lib or an app (and thus have a target)
is done by quite some feature files (and generally wrongly, as they do not
account for the new aux target), so centralize it in default_post.prf.

Change-Id: I868edbc4185be8a6c23ecd4a2c126024d73cdeb4
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:40:02 +02:00

24 lines
1.1 KiB
Plaintext

!CONFIG(separate_debug_info):CONFIG(debug, debug|release):have_target:!staticlib:!static:!isEmpty(QMAKE_OBJCOPY) {
contains(TEMPLATE, "lib") {
QMAKE_GDB_INDEX = { test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\"; } &&
QMAKE_GDB_DIR = .
} else {
QMAKE_GDB_INDEX = { test -n \"$(DESTDIR)\" && DESTDIR=\"$(DESTDIR)\" || DESTDIR=.; } &&
QMAKE_GDB_DIR = \$\$DESTDIR
}
QMAKE_GDB_INDEX += \
test \$\$(gdb --version | sed -e \'s,[^0-9]\\+\\([0-9]\\)\\.\\([0-9]\\).*,\\1\\2,;q\') -gt 72 && \
gdb --nx --batch --quiet -ex \'set confirm off\' -ex \"save gdb-index $$QMAKE_GDB_DIR\" -ex quit \'$(TARGET)\' && \
test -f $(TARGET).gdb-index && \
$$QMAKE_OBJCOPY --add-section \'.gdb_index=$(TARGET).gdb-index\' --set-section-flags \'.gdb_index=readonly\' \'$(TARGET)\' \'$(TARGET)\' && \
$$QMAKE_DEL_FILE $(TARGET).gdb-index || true
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK
QMAKE_POST_LINK = $$QMAKE_GDB_INDEX $$QMAKE_POST_LINK
silent:QMAKE_POST_LINK = @echo indexing $@ for gdb && $$QMAKE_POST_LINK
}