From 3c69b425ec39f2cee936823fc1272fb2f329605e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 29 Nov 2019 19:55:27 +0200 Subject: [PATCH] Fix noDebugSymbols. --HG-- branch : develop --- src/app/tape/tape.pro | 49 +++++++++++-------- src/app/valentina/valentina.pro | 49 +++++++++++-------- src/libs/qmuparser/qmuparser.pro | 15 +++--- .../vpropertyexplorer/vpropertyexplorer.pro | 30 ++++++------ src/test/ParserTest/ParserTest.pro | 28 ++++++----- 5 files changed, 96 insertions(+), 75 deletions(-) diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index afd214e9f..9de9503c5 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -434,30 +434,39 @@ contains(DEFINES, APPIMAGE) { unix:!macx: LIBS += -licudata -licui18n -licuuc } -noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols - # do nothing -} else { - noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols +CONFIG(release, debug|release){ + noStripDebugSymbols { # do nothing } else { - # Strip after you link all libaries. - CONFIG(release, debug|release){ - win32:!*msvc*{ - # Strip debug symbols. - QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && - QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && - QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} - } + !macx:!*msvc*{ + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + win32:!*msvc*{ + # Strip debug symbols. + QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} + } - unix:!macx{ - # Strip debug symbols. - QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg && - QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} && - QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET} - } + unix:!macx{ + # Strip after you link all libaries. + QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} + } + } else { + win32:!*msvc*{ + # Strip debug symbols. + QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && + QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && + QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} - !macx:!*msvc*{ - QMAKE_DISTCLEAN += bin/${TARGET}.dbg + QMAKE_DISTCLEAN += bin/${TARGET}.dbg + } + + unix:!macx{ + # Strip debug symbols. + QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg && + QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} && + QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET} + + QMAKE_DISTCLEAN += ${TARGET}.dbg + } } } } diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index 0d888987b..6e75bb163 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -686,30 +686,39 @@ contains(DEFINES, APPIMAGE) { unix:!macx: LIBS += -licudata -licui18n -licuuc } -noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols - # do nothing -} else { - noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols +CONFIG(release, debug|release){ + noStripDebugSymbols { # do nothing } else { - # Strip after you link all libaries. - CONFIG(release, debug|release){ - win32:!*msvc*{ - # Strip debug symbols. - QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && - QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && - QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} - } + !macx:!*msvc*{ + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + win32:!*msvc*{ + # Strip after you link all libaries. + QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} + } - unix:!macx{ - # Strip debug symbols. - QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg && - QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} && - QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET} - } + unix:!macx{ + # Strip after you link all libaries. + QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} + } + } else { + win32:!*msvc*{ + # Strip debug symbols. + QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && + QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && + QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} - !macx:!*msvc*{ - QMAKE_DISTCLEAN += bin/${TARGET}.dbg + QMAKE_DISTCLEAN += bin/${TARGET}.dbg + } + + unix:!macx{ + # Strip debug symbols. + QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg && + QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} && + QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" bin/${TARGET} + + QMAKE_DISTCLEAN += ${TARGET}.dbg + } } } } diff --git a/src/libs/qmuparser/qmuparser.pro b/src/libs/qmuparser/qmuparser.pro index daa356c3e..901824e7d 100644 --- a/src/libs/qmuparser/qmuparser.pro +++ b/src/libs/qmuparser/qmuparser.pro @@ -98,7 +98,8 @@ CONFIG(release, debug|release){ } else { !macx:!*msvc*{ noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols - # do nothing + # Strip after you link all libaries. + QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} } else { # Turn on debug symbols in release mode on Unix systems. # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. @@ -106,14 +107,10 @@ CONFIG(release, debug|release){ QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 QMAKE_LFLAGS_RELEASE = - noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols - # do nothing - } else { - # Strip debug symbols. - QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && - QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && - QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} - } + # Strip debug symbols. + QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && + QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && + QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} QMAKE_DISTCLEAN += bin/${TARGET}.dbg } diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pro b/src/libs/vpropertyexplorer/vpropertyexplorer.pro index 8d532d294..532edc006 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pro +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pro @@ -92,26 +92,28 @@ CONFIG(release, debug|release){ unix:include(warnings.pri) } - !macx:!*msvc*{ - noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols - # do nothing - } else { - # Turn on debug symbols in release mode on Unix systems. - # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. - QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 - QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 - QMAKE_LFLAGS_RELEASE = - - noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols - # do nothing + noStripDebugSymbols { + # do nothing + } else { + !macx:!*msvc*{ + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + # Strip after you link all libaries. + QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} } else { + # Strip after you link all libaries. + # Turn on debug symbols in release mode on Unix systems. + # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + # Strip debug symbols. QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} - } - QMAKE_DISTCLEAN += bin/${TARGET}.dbg + QMAKE_DISTCLEAN += bin/${TARGET}.dbg + } } } } diff --git a/src/test/ParserTest/ParserTest.pro b/src/test/ParserTest/ParserTest.pro index efc4f77b4..30bea8d73 100644 --- a/src/test/ParserTest/ParserTest.pro +++ b/src/test/ParserTest/ParserTest.pro @@ -79,7 +79,11 @@ CONFIG(release, debug|release){ } else { # Turn on debug symbols in release mode on Unix systems. # On Mac OS X temporarily disabled. Need find way how to strip binary file. - !macx:!*msvc*:QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + !macx:!*msvc*{ + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + } } } @@ -90,21 +94,21 @@ else:unix: LIBS += -L$$OUT_PWD/../../libs/qmuparser/bin/ -lqmuparser INCLUDEPATH += $$PWD/../../libs/qmuparser DEPENDPATH += $$PWD/../../libs/qmuparser -noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols - # do nothing -} else { - noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols +CONFIG(release, debug|release){ + noStripDebugSymbols { # do nothing } else { - # Strip after you link all libaries. - CONFIG(release, debug|release){ - unix:!macx{ + !macx:!*msvc*{ + noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols + # Strip after you link all libaries. + QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} + } else { # Strip debug symbols. - QMAKE_POST_LINK += objcopy --only-keep-debug $(TARGET) $(TARGET).debug && - QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(TARGET) && - QMAKE_POST_LINK += objcopy --add-gnu-debuglink $(TARGET).debug $(TARGET) + QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg && + QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} && + QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET} - QMAKE_DISTCLEAN += bin/${TARGET}.dbg + QMAKE_DISTCLEAN += ${TARGET}.dbg } } }