From 88609e6da4159174178395e28ed81badd15baa03 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 5 Nov 2013 20:36:01 +0100 Subject: Make console a no-op for WinRT Compared to other platforms there is no concept of a console application in WinRT. Hence all applications need to be UI applications and use winmain. Furthermore winmain takes care of launch arguments to be properly converted to arguments passed to user's main(). There is a chicken and egg problem with config.tests as compilation needs to have an existing entry point which is not available at configure time. Hence hardcode the entry point to main for configuring to WinRT. Those tests are pure compile tests, so the logic of the test does not change. Change-Id: I4d3186691a8440845c24b2529cc9646e86dfd8da Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/configure') 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; -- cgit v1.2.3