summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@nokia.com>2010-03-25 16:39:41 (GMT)
committerZeno Albisser <zeno.albisser@nokia.com>2010-04-06 08:29:55 (GMT)
commit1a4ee517638e1ba3cdc622af70b3d53561d23392 (patch)
tree25449e2e468402282e3ecf851427b2dcb1b61c60
parent3155d38a5fa83301d08a777c254c1afbbe4bcc22 (diff)
downloadQt-1a4ee517638e1ba3cdc622af70b3d53561d23392.zip
Qt-1a4ee517638e1ba3cdc622af70b3d53561d23392.tar.gz
Qt-1a4ee517638e1ba3cdc622af70b3d53561d23392.tar.bz2
Added variable QMAKE_TARGET.arch to qmake to be used with MSVC++
The variable QMAKE_TARGET.arch shall be used to determine cross compiling for x64 on a x32 system. Reviewed-by: Marius Storm-Olsen Task-number: QTBUG-9160
-rw-r--r--qmake/project.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 01a3843..56707cf 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -3148,6 +3148,21 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList
if (place[var].isEmpty())
place[var] = QStringList(epocRoot());
}
+#if defined(Q_OS_WIN32) && defined(Q_CC_MSVC)
+ else if(var.startsWith(QLatin1String("QMAKE_TARGET."))) {
+ QString ret, type = var.mid(13);
+ if(type == "arch") {
+ QString paths = qgetenv("PATH");
+ QString vcBin64 = qgetenv("VCINSTALLDIR").append("\\bin\\amd64");
+ QString vcBinX86_64 = qgetenv("VCINSTALLDIR").append("\\bin\\x86_amd64");
+ if(paths.contains(vcBin64,Qt::CaseInsensitive) || paths.contains(vcBinX86_64,Qt::CaseInsensitive))
+ ret = "x86_64";
+ else
+ ret = "x86";
+ }
+ place[var] = QStringList(ret);
+ }
+#endif
//qDebug("REPLACE [%s]->[%s]", qPrintable(var), qPrintable(place[var].join("::")));
return place[var];
}