Add detection of and support for Visual Studio 2015

Tested with the Preview release of November 2014.

Differences to the 2013 detection and support:
 - Option -Zc:strictStrings is present in both debug and release mode
   and is passed to qmake's own build
 - New warnings 4456, 4457 and 4458 (shadowing) are disabled
 - Compiler supports -arch:AVX2

Change-Id: I9572ff4d4aded4004c1fa5d6f13ffee5462043d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Thiago Macieira 2014-06-19 15:52:49 -07:00
parent c23d1c7695
commit ce1c53b413
7 changed files with 76 additions and 7 deletions

View File

@ -123,10 +123,22 @@ greaterThan(MSC_VER, 1799) {
# Visual Studio 2013 (12.0) / Visual C++ 18.0 and up
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
equals(MSC_VER, 1800) {
QMAKE_CFLAGS_RELEASE += -Zc:strictStrings
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
}
}
greaterThan(MSC_VER, 1899) {
# Visual Studio 2015 (14.0) / Visual C++ 19.0 and up
QMAKE_CFLAGS += -Zc:strictStrings
QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
QMAKE_CFLAGS_AVX2 = -arch:AVX2
QMAKE_CXXFLAGS += -Zc:strictStrings
QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458
}
unset(MSC_VER)

View File

@ -0,0 +1,11 @@
#
# qmake configuration for win32-msvc2015
#
# Written for Microsoft Visual C++ 2015
#
MSC_VER = 1900
MSVC_VER = 14.0
include(../common/msvc-desktop.conf)
include(../common/shell-win32.conf)
load(qt_config)

View File

@ -0,0 +1,34 @@
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "../win32-msvc2005/qplatformdefs.h"

View File

@ -1,4 +1,4 @@
!IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013" || "$(QMAKESPEC)" == "win32-icc"
!IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013" || "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-icc"
!if "$(SOURCE_PATH)" == ""
SOURCE_PATH = ..
@ -28,6 +28,8 @@ 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 $(CFLAGS_CRT)
!elseif "$(QMAKESPEC)" == "win32-msvc2015"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 $(CFLAGS_CRT)
!endif
CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \

View File

@ -1379,7 +1379,8 @@ void Configure::parseCmdLine()
dictionary[ "QMAKESPEC" ].endsWith("-msvc2008") ||
dictionary[ "QMAKESPEC" ].endsWith("-msvc2010") ||
dictionary[ "QMAKESPEC" ].endsWith("-msvc2012") ||
dictionary[ "QMAKESPEC" ].endsWith("-msvc2013")) {
dictionary[ "QMAKESPEC" ].endsWith("-msvc2013") ||
dictionary[ "QMAKESPEC" ].endsWith("-msvc2015")) {
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
} else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {

View File

@ -78,6 +78,9 @@ struct CompilerInfo{
{CC_MSVC2012, "Microsoft (R) Visual Studio 2012 C/C++ Compiler (11.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\11.0", "cl.exe"}, // link.exe, lib.exe
{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
{CC_MSVC2013, "Microsoft (R) Visual Studio 2013 C/C++ Compiler (12.0)", "Software\\Wow6432Node\\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\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VS7\\14.0", "cl.exe"}, // link.exe, lib.exe
{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_UNKNOWN, "Unknown", 0, 0},
};
@ -103,6 +106,9 @@ QString Environment::detectQMakeSpec()
{
QString spec;
switch (detectCompiler()) {
case CC_MSVC2015:
spec = "win32-msvc2015";
break;
case CC_MSVC2013:
spec = "win32-msvc2013";
break;
@ -136,6 +142,8 @@ QString Environment::detectQMakeSpec()
Compiler Environment::compilerFromQMakeSpec(const QString &qmakeSpec)
{
if (qmakeSpec == QLatin1String("win32-msvc2015"))
return CC_MSVC2015;
if (qmakeSpec == QLatin1String("win32-msvc2013"))
return CC_MSVC2013;
if (qmakeSpec == QLatin1String("win32-msvc2012"))

View File

@ -45,7 +45,8 @@ enum Compiler {
CC_MSVC2008 = 0x90,
CC_MSVC2010 = 0xA0,
CC_MSVC2012 = 0xB0,
CC_MSVC2013 = 0xC0
CC_MSVC2013 = 0xC0,
CC_MSVC2015 = 0xD0
};
struct CompilerInfo;