Fix noDebugSymbols.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-11-29 19:55:27 +02:00
parent 43d57afc77
commit 3c69b425ec
5 changed files with 96 additions and 75 deletions

View File

@ -434,19 +434,29 @@ contains(DEFINES, APPIMAGE) {
unix:!macx: LIBS += -licudata -licui18n -licuuc 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
# do nothing
} else {
# Strip after you link all libaries.
CONFIG(release, debug|release){ CONFIG(release, debug|release){
noStripDebugSymbols {
# do nothing
} else {
!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 after you link all libaries.
QMAKE_POST_LINK += objcopy --strip-debug ${TARGET}
}
} else {
win32:!*msvc*{ win32:!*msvc*{
# Strip debug symbols. # Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET}
QMAKE_DISTCLEAN += bin/${TARGET}.dbg
} }
unix:!macx{ unix:!macx{
@ -454,10 +464,9 @@ noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg && QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} && QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET} QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET}
}
!macx:!*msvc*{ QMAKE_DISTCLEAN += ${TARGET}.dbg
QMAKE_DISTCLEAN += bin/${TARGET}.dbg }
} }
} }
} }

View File

@ -686,30 +686,39 @@ contains(DEFINES, APPIMAGE) {
unix:!macx: LIBS += -licudata -licui18n -licuuc 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
# do nothing
} else {
# Strip after you link all libaries.
CONFIG(release, debug|release){ CONFIG(release, debug|release){
noStripDebugSymbols {
# do nothing
} else {
!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 after you link all libaries.
QMAKE_POST_LINK += objcopy --strip-debug ${TARGET}
}
} else {
win32:!*msvc*{ win32:!*msvc*{
# Strip debug symbols. # Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET}
QMAKE_DISTCLEAN += bin/${TARGET}.dbg
} }
unix:!macx{ unix:!macx{
# Strip debug symbols. # Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg && QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} && QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET} QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" bin/${TARGET}
}
!macx:!*msvc*{ QMAKE_DISTCLEAN += ${TARGET}.dbg
QMAKE_DISTCLEAN += bin/${TARGET}.dbg }
} }
} }
} }

View File

@ -98,7 +98,8 @@ CONFIG(release, debug|release){
} else { } else {
!macx:!*msvc*{ !macx:!*msvc*{
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols 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 { } else {
# Turn on debug symbols in release mode on Unix systems. # Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. TODO: find way how to strip binary file. # 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_CFLAGS_RELEASE += -g -gdwarf-3
QMAKE_LFLAGS_RELEASE = QMAKE_LFLAGS_RELEASE =
noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols
# do nothing
} else {
# Strip debug symbols. # Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET}
}
QMAKE_DISTCLEAN += bin/${TARGET}.dbg QMAKE_DISTCLEAN += bin/${TARGET}.dbg
} }

View File

@ -92,28 +92,30 @@ CONFIG(release, debug|release){
unix:include(warnings.pri) unix:include(warnings.pri)
} }
!macx:!*msvc*{ noStripDebugSymbols {
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing # do nothing
} else { } 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. # Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. TODO: find way how to strip binary file. # On Mac OS X temporarily disabled. TODO: find way how to strip binary file.
QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3
QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 QMAKE_CFLAGS_RELEASE += -g -gdwarf-3
QMAKE_LFLAGS_RELEASE = QMAKE_LFLAGS_RELEASE =
noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols
# do nothing
} else {
# Strip debug symbols. # Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg && QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} && QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET} QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET}
}
QMAKE_DISTCLEAN += bin/${TARGET}.dbg QMAKE_DISTCLEAN += bin/${TARGET}.dbg
} }
} }
} }
}
include (../libs.pri) include (../libs.pri)

View File

@ -79,7 +79,11 @@ CONFIG(release, debug|release){
} else { } else {
# Turn on debug symbols in release mode on Unix systems. # Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. Need find way how to strip binary file. # 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 INCLUDEPATH += $$PWD/../../libs/qmuparser
DEPENDPATH += $$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
# do nothing
} else {
# Strip after you link all libaries.
CONFIG(release, debug|release){ CONFIG(release, debug|release){
unix:!macx{ 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 ${TARGET}
} else {
# Strip debug symbols. # Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug $(TARGET) $(TARGET).debug && QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg &&
QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(TARGET) && QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink $(TARGET).debug $(TARGET) QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET}
QMAKE_DISTCLEAN += bin/${TARGET}.dbg QMAKE_DISTCLEAN += ${TARGET}.dbg
} }
} }
} }