Migrate Windows system libs to external dependencies

Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I211ce3252b836894aeeac1c85eb316d9596bca57
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Joerg Bornemann 2019-04-24 11:26:58 +02:00
parent add4b56b21
commit ce1830fd21
44 changed files with 133 additions and 59 deletions

View File

@ -13,7 +13,7 @@ FORMS = bearermonitor_240_320.ui \
bearermonitor_640_480.ui \
sessionwidget.ui
win32:LIBS += -lws2_32
win32: QMAKE_USE += ws2_32
CONFIG += console

View File

@ -235,6 +235,66 @@
"sources": [
"-lslog2"
]
},
"advapi32": {
"label": "advapi32",
"sources": [
"-ladvapi32"
]
},
"gdi32": {
"label": "gdi32",
"sources": [
"-lgdi32"
]
},
"kernel32": {
"label": "kernel32",
"sources": [
"-lkernel32"
]
},
"netapi32": {
"label": "netapi32",
"sources": [
"-lnetapi32"
]
},
"ole32": {
"label": "ole32",
"sources": [
"-lole32"
]
},
"shell32": {
"label": "shell32",
"sources": [
"-lshell32"
]
},
"uuid": {
"label": "uuid",
"sources": [
"-luuid"
]
},
"user32": {
"label": "user32",
"sources": [
"-luser32"
]
},
"winmm": {
"label": "winmm",
"sources": [
"-lwinmm"
]
},
"ws2_32": {
"label": "ws2_32",
"sources": [
"-lws2_32"
]
}
},
@ -1017,6 +1077,10 @@ If enabled, a binary dump of the Public Suffix List (http://www.publicsuffix.org
Mozilla License) is included. The data is then also used in QNetworkCookieJar::validateCookie.",
"section": "Utilities",
"output": [ "publicFeature" ]
},
"win32_system_libs": {
"label": "Windows System Libraries",
"condition": "config.win32 && libs.advapi32 && libs.gdi32 && libs.kernel32 && libs.netapi32 && libs.ole32 && libs.shell32 && libs.uuid && libs.user32 && libs.winmm && libs.ws2_32"
}
},

View File

@ -47,10 +47,8 @@ include(mimetypes/mimetypes.pri)
include(platform/platform.pri)
win32 {
LIBS_PRIVATE += -lws2_32
!winrt {
LIBS_PRIVATE += -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lwinmm
}
QMAKE_USE_PRIVATE += ws2_32
!winrt: QMAKE_USE_PRIVATE += advapi32 kernel32 ole32 shell32 uuid user32 winmm
}
darwin {

View File

@ -158,7 +158,8 @@ win32 {
io/qwindowspipereader.cpp \
io/qwindowspipewriter.cpp
LIBS += -lmpr -lnetapi32 -luserenv
LIBS += -lmpr -luserenv
QMAKE_USE_PRIVATE += netapi32
} else {
SOURCES += \
io/qstandardpaths_winrt.cpp \

View File

@ -9,11 +9,11 @@ qtConfig(dbus-linked) {
}
win32 {
LIBS_PRIVATE += \
-lws2_32 \
-ladvapi32 \
-lnetapi32 \
-luser32
QMAKE_USE_PRIVATE += \
advapi32 \
netapi32 \
user32 \
ws2_32
}
DEFINES += QT_NO_FOREACH

View File

@ -58,7 +58,7 @@ unix {
msvc: QMAKE_MOC_OPTIONS += -D_WINSOCK_DEPRECATED_NO_WARNINGS
win32:!winrt:SOURCES += socket/qnativesocketengine_win.cpp
win32:!winrt:LIBS_PRIVATE += -ladvapi32
win32:!winrt: QMAKE_USE_PRIVATE += advapi32
winrt {
SOURCES += socket/qnativesocketengine_winrt.cpp

View File

@ -30,5 +30,5 @@ qtConfig(directwrite):qtConfig(direct2d) {
DEFINES *= QT_NO_DIRECTWRITE
}
LIBS += -lole32 -lgdi32 -luser32 -ladvapi32
mingw: LIBS += -luuid
QMAKE_USE_PRIVATE += advapi32 ole32 user32 gdi32
mingw: QMAKE_USE_PRIVATE += uuid

View File

@ -8,6 +8,4 @@ HEADERS += \
DEFINES += __WRL_NO_DEFAULT_LIB__
LIBS += -lws2_32
QMAKE_USE_PRIVATE += dwrite_1
QMAKE_USE_PRIVATE += dwrite_1 ws2_32

View File

@ -2,7 +2,7 @@ TARGET = qnlabearer
QT = core core-private network network-private
LIBS += -lws2_32
QMAKE_USE_PRIVATE += ws2_32
HEADERS += qnlaengine.h \
../platformdefs_win.h \

View File

@ -8,8 +8,8 @@ QT += \
qtConfig(accessibility): QT += accessibility_support-private
qtConfig(vulkan): QT += vulkan_support-private
LIBS += -ldwmapi -lversion -lgdi32
QMAKE_USE_PRIVATE += dwrite_1 d2d1_1 d3d11_1 dxgi1_2
LIBS += -ldwmapi -lversion
QMAKE_USE_PRIVATE += gdi32 dwrite_1 d2d1_1 d3d11_1 dxgi1_2
include(../windows/windows.pri)

View File

@ -39,5 +39,4 @@ HEADERS += \
$$PWD/qwindowsuiagriditemprovider.h \
$$PWD/qwindowsuiautils.h
mingw: LIBS *= -luuid
mingw: QMAKE_USE *= uuid

View File

@ -1,15 +1,21 @@
# Note: OpenGL32 must precede Gdi32 as it overwrites some functions.
LIBS += -lole32 -luser32 -lwinspool -limm32 -lwinmm -loleaut32
LIBS += -lwinspool -limm32 -loleaut32
QT_FOR_CONFIG += gui
qtConfig(opengl):!qtConfig(opengles2):!qtConfig(dynamicgl): LIBS *= -lopengl32
mingw: LIBS *= -luuid
mingw: QMAKE_USE *= uuid
# For the dialog helpers:
LIBS += -lshlwapi -lshell32 -ladvapi32 -lwtsapi32
LIBS += -lshlwapi -lwtsapi32
QMAKE_USE_PRIVATE += d3d9/nolink
QMAKE_USE_PRIVATE += \
advapi32 \
d3d9/nolink \
ole32 \
shell32 \
user32 \
winmm
DEFINES *= QT_NO_CAST_FROM_ASCII QT_NO_FOREACH

View File

@ -8,7 +8,8 @@ QT += \
qtConfig(accessibility): QT += accessibility_support-private
qtConfig(vulkan): QT += vulkan_support-private
LIBS += -lgdi32 -ldwmapi
LIBS += -ldwmapi
QMAKE_USE_PRIVATE += gdi32
include(windows.pri)

View File

@ -8,8 +8,7 @@ QT += \
DEFINES *= QT_NO_CAST_FROM_ASCII __WRL_NO_DEFAULT_LIB__
LIBS += -lws2_32
QMAKE_USE_PRIVATE += d3d11
QMAKE_USE_PRIVATE += d3d11 ws2_32
SOURCES = \
main.cpp \

View File

@ -18,7 +18,8 @@ HEADERS += \
OTHER_FILES += windows.json
LIBS += -lwinspool -lcomdlg32 -lgdi32 -luser32
LIBS += -lwinspool -lcomdlg32
QMAKE_USE_PRIVATE += user32 gdi32
PLUGIN_TYPE = printsupport
PLUGIN_CLASS_NAME = QWindowsPrinterSupportPlugin

View File

@ -10,7 +10,7 @@ SOURCES += qwindowsvistastyle.cpp
HEADERS += qwindowsxpstyle_p.h qwindowsxpstyle_p_p.h
SOURCES += qwindowsxpstyle.cpp
LIBS_PRIVATE += -lgdi32 -luser32
QMAKE_USE_PRIVATE += user32 gdi32
# DEFINES/LIBS needed for qwizard_win.cpp and the styles
include(../../../widgets/kernel/win.pri)

View File

@ -33,7 +33,10 @@ win32 {
$$PWD/qprintengine_win_p.h
SOURCES += \
$$PWD/qprintengine_win.cpp
!winrt: LIBS_PRIVATE += -lwinspool -lcomdlg32 -lgdi32 -luser32
!winrt {
LIBS_PRIVATE += -lwinspool -lcomdlg32
QMAKE_USE_PRIVATE += user32 gdi32
}
}
unix:!darwin:qtConfig(cups) {

View File

@ -2,4 +2,7 @@
# --------------------------------------------------------------------
INCLUDEPATH += ../3rdparty/wintab
!winrt: LIBS_PRIVATE *= -lshell32 -luxtheme -ldwmapi
!winrt {
LIBS_PRIVATE *= -luxtheme -ldwmapi
QMAKE_USE_PRIVATE += shell32
}

View File

@ -23,7 +23,7 @@ winrt {
} else {
CONFIG -= qt
SOURCES = qtmain_win.cpp
LIBS += -lshell32
QMAKE_USE_PRIVATE += shell32
}
load(qt_installs)

View File

@ -23,4 +23,4 @@ TESTDATA += \
Makefile forCopying.txt forRenaming.txt \
resources/file1.ext1
win32:!winrt: LIBS += -lole32 -luuid
win32:!winrt: QMAKE_USE += ole32 uuid

View File

@ -5,4 +5,4 @@ SOURCES = tst_qfileinfo.cpp
RESOURCES += qfileinfo.qrc \
testdata.qrc
win32:!winrt: LIBS += -ladvapi32 -lnetapi32
win32:!winrt: QMAKE_USE += advapi32 netapi32

View File

@ -3,4 +3,4 @@ TARGET = tst_qlockfile
SOURCES += tst_qlockfile.cpp
QT = core-private testlib concurrent
win32:!winrt:LIBS += -ladvapi32
win32:!winrt: QMAKE_USE += advapi32

View File

@ -1,6 +1,6 @@
win32 {
SOURCES = main_win.cpp
LIBS += -luser32
QMAKE_USE += user32
}
CONFIG -= qt app_bundle

View File

@ -1,6 +1,6 @@
win32 {
SOURCES = main_win.cpp
LIBS += -luser32
QMAKE_USE += user32
}
unix {
SOURCES = main_unix.cpp

View File

@ -5,7 +5,7 @@ SOURCES = tst_qsettings.cpp
RESOURCES += qsettings.qrc
INCLUDEPATH += $$PWD/../../kernel/qmetatype
msvc: LIBS += advapi32.lib
msvc: QMAKE_USE += advapi32
darwin: LIBS += -framework CoreFoundation
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0

View File

@ -3,6 +3,6 @@ TARGET = tst_qeventloop
QT = core network testlib core-private
SOURCES = $$PWD/tst_qeventloop.cpp
win32:!winrt: LIBS += -luser32
win32:!winrt: QMAKE_USE += user32
qtConfig(glib): DEFINES += HAVE_GLIB

View File

@ -7,7 +7,7 @@ qtConfig(c++11): CONFIG += c++11
android:!android-embedded: RESOURCES += qimage.qrc
win32:!winrt: LIBS += -lgdi32 -luser32
win32:!winrt: QMAKE_USE += user32 gdi32
darwin: LIBS += -framework CoreGraphics
TESTDATA += images/*

View File

@ -5,7 +5,7 @@ QT += core-private gui-private testlib
qtHaveModule(widgets): QT += widgets widgets-private
SOURCES += tst_qpixmap.cpp
win32:!winrt:LIBS += -lgdi32 -luser32
win32:!winrt: QMAKE_USE += user32 gdi32
RESOURCES += qpixmap.qrc
TESTDATA += convertFromImage/* convertFromToHICON/* loadFromData/* images/*

View File

@ -5,4 +5,4 @@ QT += core-private network gui-private testlib
SOURCES += tst_noqteventloop.cpp
qtConfig(dynamicgl):win32:!winrt: LIBS += -luser32
qtConfig(dynamicgl):win32:!winrt: QMAKE_USE += user32

View File

@ -5,4 +5,4 @@ QT += core-private gui-private testlib
SOURCES += tst_qwindow.cpp
qtConfig(dynamicgl):win32:!winrt: LIBS += -luser32
qtConfig(dynamicgl):win32:!winrt: QMAKE_USE += user32

View File

@ -4,4 +4,4 @@ SOURCES += tst_qhostaddress.cpp
QT = core network-private testlib
win32:LIBS += -lws2_32
win32: QMAKE_USE += ws2_32

View File

@ -6,6 +6,6 @@ SOURCES += tst_qhostinfo.cpp
requires(qtConfig(private_tests))
QT = core-private network-private testlib
win32:LIBS += -lws2_32
win32: QMAKE_USE += ws2_32
winrt: WINRT_MANIFEST.capabilities += internetClientServer

View File

@ -4,7 +4,7 @@ QNETWORK_SRC = $$QT_SOURCE_TREE/src/network
INCLUDEPATH += $$QNETWORK_SRC
win32:LIBS += -lws2_32
win32: QMAKE_USE += ws2_32
unix:qtConfig(reduce_exports) {
SOURCES += $$QNETWORK_SRC/socket/qnativesocketengine_unix.cpp

View File

@ -1,7 +1,7 @@
CONFIG += testcase
SOURCES += ../tst_qtcpserver.cpp
win32:LIBS += -lws2_32
win32: QMAKE_USE += ws2_32
TARGET = ../tst_qtcpserver

View File

@ -2,8 +2,8 @@ CONFIG += testcase
QT = core-private network-private testlib
SOURCES += ../tst_qtcpsocket.cpp
win32:LIBS += -lws2_32
win32: QMAKE_USE += ws2_32
TARGET = tst_qtcpsocket
win32 {

View File

@ -11,5 +11,6 @@ win32 {
!winrt {
QT += windowsuiautomation_support-private
}
LIBS += -luuid -loleacc -loleaut32 -lole32
LIBS += -loleacc -loleaut32
QMAKE_USE += ole32 uuid
}

View File

@ -1,7 +1,7 @@
CONFIG += testcase
TARGET = tst_qmakelib
QT = core testlib
win32: LIBS += -ladvapi32
win32: QMAKE_USE += advapi32
INCLUDEPATH += ../../../../qmake/library
VPATH += ../../../../qmake/library

View File

@ -5,4 +5,4 @@ QT += core-private gui-private
SOURCES += tst_qgraphicsitem.cpp
DEFINES += QT_NO_CAST_TO_ASCII
win32:!winrt: LIBS += -luser32
win32:!winrt: QMAKE_USE += user32

View File

@ -4,7 +4,7 @@ QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += tst_qgraphicsscene.cpp
RESOURCES += images.qrc
win32:!winrt: LIBS += -luser32
win32:!winrt: QMAKE_USE += user32
DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII

View File

@ -3,4 +3,4 @@ TARGET = tst_qitemdelegate
QT += widgets widgets-private testlib
SOURCES += tst_qitemdelegate.cpp
win32:!winrt: LIBS += -luser32
win32:!winrt: QMAKE_USE += user32

View File

@ -2,4 +2,4 @@ CONFIG += testcase
TARGET = tst_qlistview
QT += widgets gui-private widgets-private core-private testlib testlib-private
SOURCES += tst_qlistview.cpp
win32:!winrt: LIBS += -luser32
win32:!winrt: QMAKE_USE += user32

View File

@ -16,4 +16,4 @@ mac {
OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
}
win32:!winrt: LIBS += -luser32 -lgdi32
win32:!winrt: QMAKE_USE += user32 gdi32

View File

@ -8,4 +8,4 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qtabwidget.cpp
win32:!winrt: LIBS += -luser32
win32:!winrt: QMAKE_USE += user32

View File

@ -12,7 +12,7 @@ HEADERS += \
win32:!winrt: {
SOURCES += $$PWD/nativewindowdump_win.cpp
LIBS *= -luser32
QMAKE_USE += user32
} else {
SOURCES += $$PWD/nativewindowdump.cpp
}