summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/common/winrt_winphone/qmake.conf1
-rw-r--r--mkspecs/features/configure.prf6
-rw-r--r--mkspecs/features/winrt/console.prf5
-rw-r--r--tools/configure/configureapp.cpp11
4 files changed, 22 insertions, 1 deletions
diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf
index 6d2aa39b87..6bcbf2ff66 100644
--- a/mkspecs/common/winrt_winphone/qmake.conf
+++ b/mkspecs/common/winrt_winphone/qmake.conf
@@ -66,7 +66,6 @@ QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /NODEFAULTLIB:ole32.lib
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_DEBUG = /DEBUG
-QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
QMAKE_LFLAGS_EXE = /MANIFEST:NO
QMAKE_LFLAGS_DLL = /MANIFEST:NO /DLL
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index 39144e7216..fe41c541a2 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -53,6 +53,12 @@ defineTest(qtCompileTest) {
# Disable qmake features which are typically counterproductive for tests
qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""
+ # On WinRT we need to change the entry point as we cannot create windows
+ # applications
+ winrt {
+ qmake_configs += " \"QMAKE_LFLAGS+=/ENTRY:main\""
+ }
+
# Clean up after previous run
exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
diff --git a/mkspecs/features/winrt/console.prf b/mkspecs/features/winrt/console.prf
new file mode 100644
index 0000000000..c4afe5b96e
--- /dev/null
+++ b/mkspecs/features/winrt/console.prf
@@ -0,0 +1,5 @@
+# This is an empty prf file to overwrite the win32 version.
+# On Windows RT all applications need to be windows applications
+# and also link to winmain. Inside winmain we create the launch
+# arguments and also initialize the UI.
+
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index d9390c8266..b55f9e64cf 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3001,6 +3001,10 @@ void Configure::detectArch()
.arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"),
QDir::toNativeSeparators(qmakespec),
QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch.pro"));
+
+ if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
+ command.append(" QMAKE_LFLAGS+=/ENTRY:main");
+
int returnValue = 0;
Environment::execute(command, &returnValue);
if (returnValue != 0) {
@@ -3101,6 +3105,13 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext
.arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"),
QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath),
extraOptions);
+
+ if (dictionary.contains("XQMAKESPEC")) {
+ const QString qmakespec = dictionary["XQMAKESPEC"];
+ if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
+ command.append(" QMAKE_LFLAGS+=/ENTRY:main");
+ }
+
int code = 0;
QString output = Environment::execute(command, &code);
//cout << output << endl;