aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2016-11-17 10:40:44 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-03-14 15:30:34 +0000
commit21b8eb121c1ef1721612c21388f802fb8b7da9e3 (patch)
tree998a781aed296424598c05933ebd2fbb4df94eb9 /src
parentab23dce95f2a7dc4f1849c54d96d84abeadf05b7 (diff)
qmake: Add support for Visual Studio 2017
Change-Id: I21f56edca3852b52edd2c5fdcce76817141e8d4a (cherry picked from qtbase/38675e18fcc841228141568a2ecfafdeb99eba2a) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/shared/proparser/qmakeevaluator.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp
index 5e318b170d..702ec650c4 100644
--- a/src/shared/proparser/qmakeevaluator.cpp
+++ b/src/shared/proparser/qmakeevaluator.cpp
@@ -968,6 +968,13 @@ static ProString msvcBinDirToQMakeArch(QString subdir)
subdir = subdir.toLower();
if (subdir == QLatin1String("amd64"))
return ProString("x86_64");
+ // Since 2017 the folder structure from here is HostX64|X86/x64|x86
+ idx = subdir.indexOf(QLatin1Char('\\'));
+ if (idx == -1)
+ return ProString("x86");
+ subdir.remove(0, idx + 1);
+ if (subdir == QLatin1String("x64"))
+ return ProString("x86_64");
return ProString(subdir);
}
@@ -1062,8 +1069,12 @@ void QMakeEvaluator::loadDefaults()
vars[ProKey("QMAKE_HOST.arch")] << archStr;
# if defined(Q_CC_MSVC) // ### bogus condition, but nobody x-builds for msvc with a different qmake
+ // Since VS 2017 we need VCToolsInstallDir instead of VCINSTALLDIR
+ QString vcInstallDir = m_option->getEnv(QLatin1String("VCToolsInstallDir"));
+ if (vcInstallDir.isEmpty())
+ vcInstallDir = m_option->getEnv(QLatin1String("VCINSTALLDIR"));
vars[ProKey("QMAKE_TARGET.arch")] = msvcArchitecture(
- m_option->getEnv(QLatin1String("VCINSTALLDIR")),
+ vcInstallDir,
m_option->getEnv(QLatin1String("PATH")));
# endif
#elif defined(Q_OS_UNIX)