diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-28 15:47:52 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-28 15:47:52 +0200 |
commit | 811edc5952caf265a4c56b52933165830838dab1 (patch) | |
tree | 787ef28916e4799083aa1b7e0d5076a35d130eca /share/qbs/modules/cpp/msvc.js | |
parent | 40787b4d077eea1211f43d9f247c560957bd6887 (diff) | |
parent | 0f647796788494947632c0874931e4d84bccad46 (diff) | |
download | qbs-811edc5952caf265a4c56b52933165830838dab1.tar.gz |
Merge 1.9 into master
Change-Id: I5320b7c62d6a80089df75c2caca79c15602c01e5
Diffstat (limited to 'share/qbs/modules/cpp/msvc.js')
-rw-r--r-- | share/qbs/modules/cpp/msvc.js | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index 4d12ee427..13e5d8821 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -57,6 +57,25 @@ function handleCpuFeatures(input, flags) { } } +function addLanguageVersionFlag(input, args) { + var cxxVersion = input.cpp.cxxLanguageVersion; + if (!cxxVersion) + return; + + // Visual C++ 2013, Update 3 + var hasStdOption = Utilities.versionCompare(input.cpp.compilerVersion, "18.00.30723") >= 0; + if (!hasStdOption) + return; + + var flag; + if (cxxVersion === "c++14") + flag = "/std:c++14"; + else if (cxxVersion !== "c++11" && cxxVersion !== "c++98") + flag = "/std:c++latest"; + if (flag) + args.push(flag); +} + function prepareCompiler(project, product, inputs, outputs, input, output, explicitlyDependsOn) { var i; var debugInformation = input.cpp.debugInformation; @@ -164,10 +183,12 @@ function prepareCompiler(project, product, inputs, outputs, input, output, expli args.push("/FI" + FileInfo.toWindowsSeparators(prefixHeaders[i])); // Language - if (tag === "cpp") + if (tag === "cpp") { args.push("/TP"); - else if (tag === "c") + addLanguageVersionFlag(input, args); + } else if (tag === "c") { args.push("/TC"); + } // Whether we're compiling a precompiled header or normal source file var pchOutput = outputs[tag + "_pch"] ? outputs[tag + "_pch"][0] : undefined; |