diff options
author | Zeno Albisser <zeno.albisser@nokia.com> | 2010-03-25 16:39:41 (GMT) |
---|---|---|
committer | Zeno Albisser <zeno.albisser@nokia.com> | 2010-04-06 08:29:55 (GMT) |
commit | 1a4ee517638e1ba3cdc622af70b3d53561d23392 (patch) | |
tree | 25449e2e468402282e3ecf851427b2dcb1b61c60 | |
parent | 3155d38a5fa83301d08a777c254c1afbbe4bcc22 (diff) | |
download | Qt-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.cpp | 15 |
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]; } |