summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/win32-msvc2017/qmake.conf10
-rw-r--r--mkspecs/win32-msvc2017/qplatformdefs.h34
-rw-r--r--qmake/Makefile.win322
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h3
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp11
-rw-r--r--qmake/library/qmakeevaluator.cpp13
-rw-r--r--src/corelib/global/qlibraryinfo.cpp4
-rw-r--r--tools/configure/configureapp.cpp3
-rw-r--r--tools/configure/environment.cpp6
-rw-r--r--tools/configure/environment.h3
10 files changed, 83 insertions, 6 deletions
diff --git a/mkspecs/win32-msvc2017/qmake.conf b/mkspecs/win32-msvc2017/qmake.conf
new file mode 100644
index 0000000000..b8351eb3fe
--- /dev/null
+++ b/mkspecs/win32-msvc2017/qmake.conf
@@ -0,0 +1,10 @@
+#
+# qmake configuration for win32-msvc2017
+#
+# Written for Microsoft Visual C++ 2017
+#
+
+MSC_VER = 1910
+MSVC_VER = 15.0
+include(../common/msvc-desktop.conf)
+load(qt_config)
diff --git a/mkspecs/win32-msvc2017/qplatformdefs.h b/mkspecs/win32-msvc2017/qplatformdefs.h
new file mode 100644
index 0000000000..7100e3aa41
--- /dev/null
+++ b/mkspecs/win32-msvc2017/qplatformdefs.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the qmake spec of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../win32-msvc2005/qplatformdefs.h"
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index e61e9503f3..96d9cb62cf 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -21,7 +21,7 @@ LINKER = link
CFLAGS_EXTRA = /Zc:wchar_t-
! elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS $(CFLAGS_CRT)
-! elseif "$(QMAKESPEC)" == "win32-msvc2015"
+! elseif "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-msvc2017"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 /wd4577 $(CFLAGS_CRT)
! else
! error Unsupported compiler for this Makefile
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 96923ba23d..7f924a9a2b 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -57,7 +57,8 @@ enum DotNET {
NET2010 = 0xa0,
NET2012 = 0xb0,
NET2013 = 0xc0,
- NET2015 = 0xd0
+ NET2015 = 0xd0,
+ NET2017 = 0xe0
};
/*
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 5e3e11fd5c..d4930d9a05 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -70,6 +70,7 @@ struct DotNetCombo {
const char *versionStr;
const char *regKey;
} dotNetCombo[] = {
+ {NET2017, "MSVC.NET 2017 (15.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\15.0"},
{NET2015, "MSVC.NET 2015 (14.0)", "Software\\Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 (12.0)", "Software\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 Express Edition (12.0)", "Software\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir"},
@@ -164,6 +165,8 @@ const char _slnHeader120[] = "Microsoft Visual Studio Solution File, Format
"\n# Visual Studio 2013";
const char _slnHeader140[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
"\n# Visual Studio 2015";
+const char _slnHeader141[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
+ "\n# Visual Studio 2017";
// The following UUID _may_ change for later servicepacks...
// If so we need to search through the registry at
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects
@@ -394,6 +397,8 @@ QString VcprojGenerator::retrievePlatformToolSet() const
return QStringLiteral("v120") + suffix;
case NET2015:
return QStringLiteral("v140") + suffix;
+ case NET2017:
+ return QStringLiteral("v141") + suffix;
default:
return QString();
}
@@ -620,6 +625,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) {
+ case NET2017:
+ t << _slnHeader141;
+ break;
case NET2015:
t << _slnHeader140;
break;
@@ -954,6 +962,9 @@ void VcprojGenerator::initProject()
// Own elements -----------------------------
vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString();
switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) {
+ case NET2017:
+ vcProject.Version = "15.00";
+ break;
case NET2015:
vcProject.Version = "14.00";
break;
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index cd5676093d..4083fc5291 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -973,6 +973,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);
}
@@ -1064,8 +1071,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)
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 8bcacca13f..14be4c3475 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -310,8 +310,10 @@ QLibraryInfo::buildDate()
# define COMPILER_STRING "MSVC 2012"
# elif _MSC_VER < 1900
# define COMPILER_STRING "MSVC 2013"
-# elif _MSC_VER < 2000
+# elif _MSC_VER < 1910
# define COMPILER_STRING "MSVC 2015"
+# elif _MSC_VER < 2000
+# define COMPILER_STRING "MSVC 2017"
# else
# define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER)
# endif
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 88dcd8170b..a908db0707 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -1458,7 +1458,8 @@ void Configure::parseCmdLine()
dictionary[ "QMAKESPEC" ].endsWith("-msvc2010") ||
dictionary[ "QMAKESPEC" ].endsWith("-msvc2012") ||
dictionary[ "QMAKESPEC" ].endsWith("-msvc2013") ||
- dictionary[ "QMAKESPEC" ].endsWith("-msvc2015")) {
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc2015") ||
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc2017")) {
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
} else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp
index 153a141d7a..f950945597 100644
--- a/tools/configure/environment.cpp
+++ b/tools/configure/environment.cpp
@@ -76,6 +76,7 @@ struct CompilerInfo{
{CC_MSVC2013, "Microsoft (R) Visual Studio 2013 C/C++ Compiler (12.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0", "cl.exe"}, // link.exe, lib.exe
// Microsoft skipped version 13
{CC_MSVC2015, "Microsoft (R) Visual Studio 2015 C/C++ Compiler (14.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\14.0", "cl.exe"}, // link.exe, lib.exe
+ {CC_MSVC2017, "Microsoft (R) Visual Studio 2017 C/C++ Compiler (15.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\15.0", "cl.exe"}, // link.exe, lib.exe
{CC_UNKNOWN, "Unknown", 0, 0},
};
@@ -101,6 +102,9 @@ QString Environment::detectQMakeSpec()
{
QString spec;
switch (detectCompiler()) {
+ case CC_MSVC2017:
+ spec = "win32-msvc2017";
+ break;
case CC_MSVC2015:
spec = "win32-msvc2015";
break;
@@ -137,6 +141,8 @@ QString Environment::detectQMakeSpec()
Compiler Environment::compilerFromQMakeSpec(const QString &qmakeSpec)
{
+ if (qmakeSpec == QLatin1String("win32-msvc2017"))
+ return CC_MSVC2017;
if (qmakeSpec == QLatin1String("win32-msvc2015"))
return CC_MSVC2015;
if (qmakeSpec == QLatin1String("win32-msvc2013"))
diff --git a/tools/configure/environment.h b/tools/configure/environment.h
index d096782e70..6b0e9bb9fe 100644
--- a/tools/configure/environment.h
+++ b/tools/configure/environment.h
@@ -46,7 +46,8 @@ enum Compiler {
CC_MSVC2010 = 0xA0,
CC_MSVC2012 = 0xB0,
CC_MSVC2013 = 0xC0,
- CC_MSVC2015 = 0xD0
+ CC_MSVC2015 = 0xD0,
+ CC_MSVC2017 = 0xE0
};
struct CompilerInfo;