summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-10-15 17:04:27 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-10-17 12:13:00 +0200
commitb5af1408099dedd132f36e04d19cb5771a23ec28 (patch)
tree85109c13469dcde91aea87e29ed52c116732fbf8 /mkspecs/features
parent8ec4fd9cffe7977f6d7cb68ce38de4386a5795d6 (diff)
Generalize the winmain/qtmain entry-point library
The use-case is relevant for other platforms as well. Now that Qt has a module system we can also replace a lot of the hand crafted logic for linking with simpler constructs. Change-Id: Ib6853aaf81bfea79c31f2de741d65b4b56f23ef6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/entrypoint.prf2
-rw-r--r--mkspecs/features/win32/default_pre.prf2
-rw-r--r--mkspecs/features/win32/idcidl.prf3
-rw-r--r--mkspecs/features/win32/windows.prf11
4 files changed, 4 insertions, 14 deletions
diff --git a/mkspecs/features/entrypoint.prf b/mkspecs/features/entrypoint.prf
new file mode 100644
index 0000000000..8442f8930b
--- /dev/null
+++ b/mkspecs/features/entrypoint.prf
@@ -0,0 +1,2 @@
+qt:!console:contains(TEMPLATE, ".*app"): \
+ QT_PRIVATE += entrypoint
diff --git a/mkspecs/features/win32/default_pre.prf b/mkspecs/features/win32/default_pre.prf
index 4bd1653aee..be8e20130f 100644
--- a/mkspecs/features/win32/default_pre.prf
+++ b/mkspecs/features/win32/default_pre.prf
@@ -1,2 +1,2 @@
-CONFIG = windows $$CONFIG
+CONFIG = windows $$CONFIG entrypoint
load(default_pre)
diff --git a/mkspecs/features/win32/idcidl.prf b/mkspecs/features/win32/idcidl.prf
index 922ae3f99e..67d3cf0cb0 100644
--- a/mkspecs/features/win32/idcidl.prf
+++ b/mkspecs/features/win32/idcidl.prf
@@ -3,8 +3,7 @@ build_pass:console {
warning("Remove 'console' from your CONFIG.")
}
-# Do not link qtmain.lib
-QMAKE_LIBS_QT_ENTRY =
+CONFIG -= entrypoint
ACTIVEQT_VERSION = $$VERSION
isEmpty(ACTIVEQT_VERSION):ACTIVEQT_VERSION = 1.0
diff --git a/mkspecs/features/win32/windows.prf b/mkspecs/features/win32/windows.prf
index 272170d428..66ef21f2de 100644
--- a/mkspecs/features/win32/windows.prf
+++ b/mkspecs/features/win32/windows.prf
@@ -2,15 +2,4 @@ CONFIG -= console
QMAKE_LFLAGS += $$QMAKE_LFLAGS_WINDOWS
contains(TEMPLATE, ".*app") {
QMAKE_LFLAGS += $$QMAKE_LFLAGS_EXE
- mingw:DEFINES += QT_NEEDS_QMAIN
-
- qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
- isEqual(entryLib, -lqtmain) {
- lib = $$QT.core.libs/$${QMAKE_PREFIX_STATICLIB}qtmain$$QT_LIBINFIX$$qtPlatformTargetSuffix().$$QMAKE_EXTENSION_STATICLIB
- PRE_TARGETDEPS += $$lib
- QMAKE_LIBS += $$lib
- } else {
- QMAKE_LIBS += $${entryLib}
- }
- }
}