Make it possible to force generation of debug info in release builds

Change-Id: Ie79e5a6a87475d5140163a2a547b4385a53fc05f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Andreas Holzammer 2012-08-07 22:22:38 +02:00 committed by Qt by Nokia
parent 63eb5b5a79
commit 661cf8ff4e
3 changed files with 37 additions and 4 deletions

13
configure vendored
View File

@ -691,6 +691,7 @@ CFG_QCONFIG=full
CFG_DEBUG=auto CFG_DEBUG=auto
CFG_MYSQL_CONFIG= CFG_MYSQL_CONFIG=
CFG_DEBUG_RELEASE=no CFG_DEBUG_RELEASE=no
CFG_FORCEDEBUGINFO=no
CFG_SHARED=yes CFG_SHARED=yes
CFG_SM=auto CFG_SM=auto
CFG_XSHAPE=auto CFG_XSHAPE=auto
@ -1356,6 +1357,9 @@ while [ "$#" -gt 0 ]; do
debug) debug)
CFG_DEBUG="$VAL" CFG_DEBUG="$VAL"
;; ;;
force-debug-info)
CFG_FORCEDEBUGINFO="$VAL"
;;
developer-build|commercial|opensource) developer-build|commercial|opensource)
# These switches have been dealt with already # These switches have been dealt with already
;; ;;
@ -2501,6 +2505,10 @@ if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
QT_CONFIG="$QT_CONFIG build_all debug_and_release" QT_CONFIG="$QT_CONFIG build_all debug_and_release"
fi fi
if [ "$CFG_FORCEDEBUGINFO" = "yes" ]; then
QT_CONFIG="$QT_CONFIG force_debug_info"
fi
# pass on $CFG_SDK to the configure tests. # pass on $CFG_SDK to the configure tests.
if [ '!' -z "$CFG_SDK" ]; then if [ '!' -z "$CFG_SDK" ]; then
MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK" MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK"
@ -2977,6 +2985,8 @@ Configure options:
-debug-and-release . Compile and link two versions of Qt, with and without -debug-and-release . Compile and link two versions of Qt, with and without
debugging turned on (Mac only). debugging turned on (Mac only).
-force-debug-info .. Create symbol files for release builds.
-developer-build ... Compile and link Qt with Qt developer options (including auto-tests exporting) -developer-build ... Compile and link Qt with Qt developer options (including auto-tests exporting)
-opensource ........ Compile and link the Open-Source Edition of Qt. -opensource ........ Compile and link the Open-Source Edition of Qt.
@ -6036,6 +6046,9 @@ if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
else else
echo "Debug .................. $CFG_DEBUG" echo "Debug .................. $CFG_DEBUG"
fi fi
if [ "$CFG_RELEASE" = "yes" ] || [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
echo "Force debug info ....... $CFG_FORCEDEBUGINFO"
fi
echo "C++11 support .......... $CFG_CXX11" echo "C++11 support .......... $CFG_CXX11"
if [ -n "$PKG_CONFIG" ]; then if [ -n "$PKG_CONFIG" ]; then
echo "pkg-config ............. yes" echo "pkg-config ............. yes"

View File

@ -12,8 +12,11 @@ QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
!staticlib:!static:CONFIG(release, debug|release):have_target: \ # is it applicable? !staticlib:!static:CONFIG(release, debug|release):have_target: \ # is it applicable?
!contains(TARGET, .*phony_target.*): \ # monster hack, you don't really see this here, right? ;) !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? system($$QT_BREAKPAD_ROOT_PATH/qtbreakpadsymbols --breakpad-exists) { # do we really have it?
CONFIG += breakpad CONFIG += breakpad force_debug_info
CONFIG -= no_debug_info separate_debug_info CONFIG -= no_debug_info separate_debug_info
}
force_debug_info {
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
@ -27,10 +30,13 @@ incredibuild_xge {
CONFIG = incredibuild_xge $$CONFIG CONFIG = incredibuild_xge $$CONFIG
} }
force_debug_info:win32 {
load(resolve_target)
QMAKE_CLEAN += $$replace(QMAKE_RESOLVED_TARGET, ...$, pdb) # for the debug case it is hardcoded in qmake
}
breakpad { breakpad {
load(resolve_target) load(resolve_target)
win32: QMAKE_CLEAN += $$replace(QMAKE_RESOLVED_TARGET, ...$, pdb) # for the debug case it is hardcoded in qmake
DEBUGFILENAME = $$shell_quote($$shell_path($$QMAKE_RESOLVED_TARGET)) DEBUGFILENAME = $$shell_quote($$shell_path($$QMAKE_RESOLVED_TARGET))
PROJECTPATH = $$shell_quote($$shell_path($$OUT_PWD)) PROJECTPATH = $$shell_quote($$shell_path($$OUT_PWD))

View File

@ -276,6 +276,7 @@ Configure::Configure(int& argc, char** argv)
dictionary[ "BUILD" ] = "debug"; dictionary[ "BUILD" ] = "debug";
dictionary[ "BUILDALL" ] = "auto"; // Means yes, but not explicitly dictionary[ "BUILDALL" ] = "auto"; // Means yes, but not explicitly
dictionary[ "FORCEDEBUGINFO" ] = "no";
dictionary[ "BUILDTYPE" ] = "none"; dictionary[ "BUILDTYPE" ] = "none";
@ -459,6 +460,8 @@ void Configure::parseCmdLine()
dictionary[ "BUILDALL" ] = "no"; dictionary[ "BUILDALL" ] = "no";
} else if (configCmdLine.at(i) == "-debug-and-release") } else if (configCmdLine.at(i) == "-debug-and-release")
dictionary[ "BUILDALL" ] = "yes"; dictionary[ "BUILDALL" ] = "yes";
else if (configCmdLine.at(i) == "-force-debug-info")
dictionary[ "FORCEDEBUGINFO" ] = "yes";
else if (configCmdLine.at(i) == "-shared") else if (configCmdLine.at(i) == "-shared")
dictionary[ "SHARED" ] = "yes"; dictionary[ "SHARED" ] = "yes";
@ -1596,6 +1599,8 @@ bool Configure::displayHelp()
desc("BUILD", "debug", "-debug", "Compile and link Qt with debugging turned on."); desc("BUILD", "debug", "-debug", "Compile and link Qt with debugging turned on.");
desc("BUILDALL", "yes", "-debug-and-release", "Compile and link two Qt libraries, with and without debugging turned on.\n"); desc("BUILDALL", "yes", "-debug-and-release", "Compile and link two Qt libraries, with and without debugging turned on.\n");
desc("FORCEDEBUGINFO", "yes","-force-debug-info", "Create symbol files for release builds.\n");
desc("OPENSOURCE", "opensource", "-opensource", "Compile and link the Open-Source Edition of Qt."); desc("OPENSOURCE", "opensource", "-opensource", "Compile and link the Open-Source Edition of Qt.");
desc("COMMERCIAL", "commercial", "-commercial", "Compile and link the Commercial Edition of Qt.\n"); desc("COMMERCIAL", "commercial", "-commercial", "Compile and link the Commercial Edition of Qt.\n");
@ -2392,6 +2397,8 @@ void Configure::generateOutputVars()
if (dictionary[ "BUILDALL" ] == "yes") { if (dictionary[ "BUILDALL" ] == "yes") {
qtConfig += "build_all"; qtConfig += "build_all";
} }
if (dictionary[ "FORCEDEBUGINFO" ] == "yes")
qtConfig += "force_debug_info";
qmakeConfig += dictionary[ "BUILD" ]; qmakeConfig += dictionary[ "BUILD" ];
dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ]; dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ];
@ -3204,7 +3211,14 @@ void Configure::displayConfig()
sout << "Host Architecture..........." << dictionary["QT_HOST_ARCH"] sout << "Host Architecture..........." << dictionary["QT_HOST_ARCH"]
<< ", features:" << dictionary["QT_HOST_CPU_FEATURES"] << endl; << ", features:" << dictionary["QT_HOST_CPU_FEATURES"] << endl;
sout << "Maketool...................." << dictionary[ "MAKE" ] << endl; sout << "Maketool...................." << dictionary[ "MAKE" ] << endl;
sout << "Debug symbols..............." << (dictionary[ "BUILD" ] == "debug" ? "yes" : "no") << endl; if (dictionary[ "BUILDALL" ] == "yes") {
sout << "Debug build................." << "yes (combined)" << endl;
sout << "Default build..............." << dictionary[ "BUILD" ] << endl;
} else {
sout << "Debug......................." << (dictionary[ "BUILD" ] == "debug" ? "yes" : "no") << endl;
}
if (dictionary[ "BUILD" ] == "release" || dictionary[ "BUILDALL" ] == "yes")
sout << "Force debug info............" << dictionary[ "FORCEDEBUGINFO" ] << endl;
sout << "Link Time Code Generation..." << dictionary[ "LTCG" ] << endl; sout << "Link Time Code Generation..." << dictionary[ "LTCG" ] << endl;
sout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl; sout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl;
sout << "RTTI support................" << dictionary[ "RTTI" ] << endl; sout << "RTTI support................" << dictionary[ "RTTI" ] << endl;