Disable debug-and-release builds for MinGW

The requirement to separate debug and release DLLs on Windows stems from
the Visual Studio C run-time library appearing in two different variants
(debug and release) and not mixing well. It's possible to perform builds
without optimzations and with debug symbols while linking against the
release version of the C run-time, but at the same time the debug
version of the run-time brings other developer visible advantages.

MinGW on the other hand does not have this distinction, does not ship
with separate DLLS and does also not require the VS C runtime library.
Therefore we do not need this separation for MinGW, which means that our
packages can be reduced in size and application developers wishing to
debug their applications do not have to use debug builds of the Qt
libraries or run into Qt internal debug code.

Task-number: QTBUG-78445
Change-Id: Idf588606091298dc44262c4c89e689df18d34747
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Simon Hausmann 2019-07-22 10:45:26 +02:00
parent cdb7d013cb
commit 4d289edb14
10 changed files with 19 additions and 12 deletions

View File

@ -766,7 +766,7 @@
"debug_and_release": {
"label": "Compile libs in debug and release mode",
"autoDetect": "input.debug == ''",
"condition": "config.darwin || config.win32",
"condition": "config.darwin || (config.win32 && !config.gcc)",
"output": [ "publicFeature", "publicQtConfig", "debugAndRelease" ]
},
"force_debug_info": {

View File

@ -17,7 +17,7 @@ include(g++-base.conf)
MAKEFILE_GENERATOR = MINGW
QMAKE_PLATFORM = win32 mingw
CONFIG += debug_and_release debug_and_release_target precompile_header
CONFIG += precompile_header
DEFINES += UNICODE _UNICODE WIN32 MINGW_HAS_SECURE_API=1
QMAKE_COMPILER_DEFINES += __GNUC__ _WIN32
# can't add 'DEFINES += WIN64' and 'QMAKE_COMPILER_DEFINES += _WIN64' defines for

View File

@ -5,7 +5,7 @@ defineReplace(qtPlatformTargetSuffix) {
else: CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
mac: return($${suffix}_debug)
win32: return($${suffix}d)
win32:!gcc: return($${suffix}d)
}
}
return($$suffix)

View File

@ -53,6 +53,7 @@ CONFIG(debug, debug|release) {
}
!isEmpty(BUILD_PASS): BUILDSUBDIR = $$lower($$BUILD_PASS)/
else: BUILDSUBDIR = $$PWD/
# c++11 is needed by MinGW to get support for unordered_map.
CONFIG += stl exceptions c++11 c++14

View File

@ -22,7 +22,7 @@ android:!android-embedded {
RESOURCES += android_testdata.qrc
}
win32 {
win32:debug_and_release {
CONFIG(debug, debug|release): LIBS += -Lstaticplugin/debug
else: LIBS += -Lstaticplugin/release
} else {

View File

@ -12,7 +12,7 @@ msvc: DEFINES += WIN32_MSVC
target.path = $$[QT_INSTALL_TESTS]/tst_qlibrary
INSTALLS += target
win32 {
win32:debug_and_release {
CONFIG(debug, debug|release) {
DESTDIR = ../debug/
} else {

View File

@ -13,12 +13,18 @@ msvc: DEFINES += WIN32_MSVC
# We want to test if we can load a shared library with *any* filename...
win32 {
CONFIG(debug, debug|release) {
BUILD_FOLDER = debug
debug_and_release {
CONFIG(debug, debug|release)) {
BUILD_FOLDER = debug
} else {
BUILD_FOLDER = release
}
DESTDIR = ../$$BUILD_FOLDER/
} else {
BUILD_FOLDER = release
BUILD_FOLDER =
DESTDIR = ../
}
DESTDIR = ../$$BUILD_FOLDER/
# vcproj and Makefile generators refer to target differently
contains(TEMPLATE,vc.*) {

View File

@ -3,7 +3,7 @@ TARGET = ../tst_qlibrary
QT = core testlib
SOURCES = ../tst_qlibrary.cpp
win32 {
win32:debug_and_release {
CONFIG(debug, debug|release) {
TARGET = ../../debug/tst_qlibrary
} else {

View File

@ -5,7 +5,7 @@ qtConfig(private_tests): QT += core-private
SOURCES = ../tst_qpluginloader.cpp ../fakeplugin.cpp
HEADERS = ../theplugin/plugininterface.h
win32 {
win32:debug_and_release {
CONFIG(debug, debug|release) {
TARGET = ../../debug/tst_qpluginloader
LIBS += -L../staticplugin/debug

View File

@ -6,7 +6,7 @@ QT = core network testlib
MOC_DIR=tmp
win32 {
win32:debug_and_release {
CONFIG(debug, debug|release) {
DESTDIR = ../debug
} else {