pass windows/console linker flags to DLLs and executables

Pass QMAKE_LFLAGS_WINDOWS and QMAKE_LFLAGS_CONSOLE to QMAKE_FLAGS
regardless of the project template.

The /SUBSYSTEM linker switch is not exclusively meant for executables
but can also be applied when linking dynamic libraries.
This is needed when building DLLs for Windows XP with VS >= 2012.

Task-number: QTBUG-41504
Change-Id: I5966cba1b6756e15275fa5d7fdbc42b99c95c07b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Joerg Bornemann 2014-10-02 15:11:18 +02:00 committed by Simo Fält
parent 523f5c6722
commit cd1dff7556
2 changed files with 5 additions and 7 deletions

View File

@ -1,6 +1,5 @@
CONFIG -= windows
QMAKE_LFLAGS += $$replace(QMAKE_LFLAGS_CONSOLE, @QMAKE_SUBSYSTEM_SUFFIX@, $$QMAKE_SUBSYSTEM_SUFFIX)
contains(TEMPLATE, ".*app") {
QMAKE_LFLAGS += \
$$replace(QMAKE_LFLAGS_CONSOLE, @QMAKE_SUBSYSTEM_SUFFIX@, $$QMAKE_SUBSYSTEM_SUFFIX) \
$$QMAKE_LFLAGS_EXE
QMAKE_LFLAGS += $$QMAKE_LFLAGS_EXE
}

View File

@ -1,8 +1,7 @@
CONFIG -= console
contains(TEMPLATE, ".*app"){
QMAKE_LFLAGS += \
$$replace(QMAKE_LFLAGS_WINDOWS, @QMAKE_SUBSYSTEM_SUFFIX@, $$QMAKE_SUBSYSTEM_SUFFIX) \
$$QMAKE_LFLAGS_EXE
QMAKE_LFLAGS += $$replace(QMAKE_LFLAGS_WINDOWS, @QMAKE_SUBSYSTEM_SUFFIX@, $$QMAKE_SUBSYSTEM_SUFFIX)
contains(TEMPLATE, ".*app") {
QMAKE_LFLAGS += $$QMAKE_LFLAGS_EXE
mingw:DEFINES += QT_NEEDS_QMAIN
qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {